Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-native-floating-action
Advanced tools
Floating action button for React Native
Open the following click on your phone: Expo link
npm i react-native-floating-action --save
or
yarn add react-native-floating-action
To see how works, take a look into example/FloatingAction
First step: import the component:
import { FloatingAction } from 'react-native-floating-action';
Second step: define the buttons
const actions = [{
text: 'Accessibility',
icon: require('./images/ic_accessibility_white.png'),
name: 'bt_accessibility',
position: 2
}, {
text: 'Language',
icon: require('./images/ic_language_white.png'),
name: 'bt_language',
position: 1
}, {
text: 'Location',
icon: require('./images/ic_room_white.png'),
name: 'bt_room',
position: 3
}, {
text: 'Video',
icon: require('./images/ic_videocam_white.png'),
name: 'bt_videocam',
position: 4
}];
Third step: use it
<View style={styles.container}>
<Text style={styles.example}>
Floating Action example
</Text>
<FloatingAction
actions={actions}
onPressItem={
(name) => {
console.log(`selected button: ${name}`);
}
}
/>
</View>
FloatingAction
Property | Type | Default | Description |
---|---|---|---|
actions | array | [] | Actions to be show once user press the main button |
buttonColor | string | #1253bc | Color of the main button |
distanceToEdge | number | 30 | Distance from button to edge |
visible | boolean | true | Hide or Show the component using an animation |
overlayColor | string | rgba(68, 68, 68, 0.6) | Color of the background overlay |
position | string | right | Position to render the main button and actions, options: (left, right, center) |
overrideWithAction | string | false | Override the main action with the first action inside list actions, will not show other action |
floatingIcon | node | ReactElement | |
onPressItem | function | Function to be call as soon as the user select an option from actions. Will return the name of the action. |
Actions
Property | Type | Default | Description |
---|---|---|---|
color | string | #1253bc | Color of the action button |
icon | any | Icon to be rendered inside the action, will accept an URL or React.Image. If we want to send an URL we need to send it in this way: icon: { uri: 'https://imageurl.com' } if we want to send a React.Image we will use it in this way: icon: require('path/image') | |
name | string | Name of the icon, this name is used as parameter for onPressItem action | |
text | string | Text to show near to the button. This option only works for position = ['left', 'right'] |
FAQs
Simple (FAB) floating action component for react-native
We found that react-native-floating-action 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.