Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
react-native-circle-floatmenu
Advanced tools
Readme
Geremih´s Path-esque circular action menu inspired by CircularFloatingActionMenu modified and tested on RN_0.63 by Kur.
npm i react-native-circle-floatmenu --save
First, require it from your app's JavaScript files with:
import CircleButton from 'react-native-circle-floatmenu';
CircleButton
component is the main component which wraps everything and provides a couple of props (see Config below).
CircleButton.Item
specifies an Circle Button. You have to include at least 1 CircleButton.Item
.
The following Basic example can be found in example/Basic
.
import React from 'react';
import {
StyleSheet,
View,
} from 'react-native';
import CircleButton from "react-native-circle-floatmenu";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
const App = () => {
return (
<View style={styles.btn_container}>
<CircleButton buttonColor="rgba(0,0,0,1)" position="topleft">
<CircleButton.Item
position="absolute"
buttonColor="#000"
title="Perfil"
onPress={() => console.log("BtnPress")}
>
<Icon
name="card-account-details"
style={styles.circleButtonIcon}
/>
</CircleButton.Item>
<CircleButton.Item
position="absolute"
buttonColor="#000"
title="Perfil"
onPress={() => console.log("BtnPress")}
>
<Icon name="bookmark-outline" style={styles.circleButtonIcon} />
</CircleButton.Item>
<CircleButton.Item
position="absolute"
buttonColor="#000"
title="Perfil"
onPress={() => console.log("BtnPress")}
>
<Icon
name="briefcase-outline"
style={styles.circleButtonIcon}
/>
</CircleButton.Item>
<CircleButton.Item
position="absolute"
buttonColor="#000"
title="Perfil"
onPress={() => console.log("BtnPress")}
>
<Icon
name="reply"
style={styles.circleButtonIcon}
/>
</CircleButton.Item>
<CircleButton.Item
position="absolute"
buttonColor="#000"
title="Perfil"
onPress={() => console.log("BtnPress")}
>
<Icon
name="power-standby"
style={styles.circleButtonIcon}
/>
</CircleButton.Item>
</CircleButton>
</View>
);
};
const styles = StyleSheet.create({
btn_container: {
flex: 1,
backgroundColor: "#59a6eb",
justifyContent: "center",
width: "100%",
elevation: 8,
borderRadius: 5,
margin: 1,
},
circleButtonIcon: {
fontSize: 20,
height: 22,
color: "white",
},
});
export default App;
This will create a floating Button in the upper left corner with 5 action buttons.
Also this example uses react-native-vector-icons
for the button Icons.
<CircleButton
buttonColor="rgba(231,76,60,1)"
onPress={() => {
console.log("hi");
}}
/>
Property | Type | Default | Description |
---|---|---|---|
active | boolean | false | action buttons visible or not |
autoInactive | boolean | true | Auto hide ActionButtons when ActionButton.Item is pressed. |
position | string | "center" | one of: left center right topleft topcenter and topright |
radius | number | 100 | radius of menu |
bgColor | string | "transparent" | color of overlay when ActionButtons are visible |
buttonColor | string | "rgba(0,0,0,1)" | background color of the +Button (must be rgba value!) |
btnOutRange | string | props.buttonColor | button background color to animate to |
outRangeScale | number | 1 | changes size of button during animation |
onPress | function | null | fires, when ActionButton is tapped |
onLongPress | function | null | fires, when ActionButton is long pressed |
onOverlayPress | function | null | fires, when Overlay is pressed |
icon | Component | + | Custom component for ActionButton Icon |
backdrop | Component | false | Custom component for use as Backdrop (i.e. BlurView, VibrancyView) |
degrees | number | 135 | degrees to rotate icon |
Property | Type | Default | Description |
---|---|---|---|
onPress | func | null | required function, triggers when a button is tapped |
buttonColor | string | same as + button | background color of the Button |
startDegree | number | 0 | degrees to start the rotation of the Item |
endDegree | number | 720 | degrees to end the rotation of the Item |
FAQs
Path-esque circular action menu inspired by react-native-circular-action-menu.
The npm package react-native-circle-floatmenu receives a total of 22 weekly downloads. As such, react-native-circle-floatmenu popularity was classified as not popular.
We found that react-native-circle-floatmenu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.