0.0.6 • Published 2 years ago

react-native-floating-action-circle-button v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React native floating action circle button

Simple floating action button component with circle button for react native.

Demo

demoFloating

Installation

  npm install react-native-floating-action-circle-button

Usage/Examples

First step: import Component

import FloatingActionButton from 'react-native-floating-action-circle-button';

Second step: add actions list

const actions = [
  {
    icon: Assets.Icons.activeBin,
    label: 'Delete',
    disable: false,
    onPress: null,
  },
  {
    icon: Assets.Icons.inactiveCancelInvoice,
    label: 'Cancel',
    disable: true,
    onPress: null,
  },
  {
    icon: Assets.Icons.activeReport,
    label: 'Report',
    disable: false,
    onPress: null,
  },
];

Third step: place it in the screen

<FloatingActionButton 
  actions={actions}
  backgroundStyle={{
    marginRight: 17,
  }}
  actionButtonStyle={{
    marginRight: 17,
  }}
  anchorButtonStyle={{
    marginRight: 17,
  }}
/>

Props

PropertyTypeDefaultDescription
actionsArray<Object>[]Actions to be shown when user press the anchor Floating Button. Must pass at less one action
containerStylestylenullThe custom style for wrapper container
actionButtonStylestylenullThe custom style for actions button
backgroundStylestylenullThe custom style for background and disable
anchorInactiveIconImageSourcePropType...Icon to be rendered for anchor button when it's not pressed
anchorActiveIconImageSourcePropTypeXIcon to be rendered for anchor button when it is pressed
anchorButtonStylestylenullThe custom style for anchor button
anchorIconStylestylenullThe custom style for icon inside anchor button

actions props

PropertyTypeDefaultDescription
disableBooleanfalseActions status
labelstring| Label for action
onPressFunctionnullFunction to be called when action button is pressed. Can't press when disable is true
iconImageSourcePropTypenullIcon to be rendered inside action button
iconStylestylenullThe custom style for icon inside action button
buttonStylestylenullThe custom style for action button

License

MIT