1.0.7 • Published 4 years ago

react-native-action-floating-button v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Example Image

Basic Usage

import {
  FloatingButton,
  FloatingButtonChild,
} from "react-native-action-floating-button";

const Floating = () => (
  <FloatingButton
    hasChildren={false}
    icon={<Text>{/*Here your Icon*/}</Text>}
    background="blue"
    onPress={() => foo()}
  />
);

Usage With Children

import {
  FloatingButton,
  FloatingButtonChild,
} from "react-native-action-floating-button";

const Floating = () => (
  <FloatingButton
    hasChildren={true}
    icon={<Text>{/*Here your Icon*/}</Text>}
    backgroundColor="blue"
  >
    <FloatingButtonChild backgroundColor="blue" title="Tooltip message">
      <Text>{/*Here your Icon*/}</Text>
    </FloatingButtonChild>
  </FloatingButton>
);

Props

Floating Child

OptionsDefaultValueHow To use
backgroundColorredrgb or hexUse to change the color of the button
hasChildrentruetrue, falseIf true instead of using onPress it opens the floatingButtonChild
onPressnonemethodUse to change the behavior when it's pressed with hasChildren on false.
iconnoneTextUse to display some text or icon
padding10NumberUse to add padding
alignItemsflex-endflex-start,center,flex-endUse to choose where you want to put the button
[children]noneCreate the FloatingButtonChild as children of a FloatingButton
shadownonecss styleUse to set the shadow of the button

FloatingButtonChild

OptionsDefaultValueHow To use
backgroundColorredrgb or hexUse to change the color of the button
titlenonestringUse to change the tooltip
[children]noneUse to change the icon or text of the button
shadownonecss styleUse to set the shadow of the button
flexDirectionrowrow, row-reverseSet to row-reverse to reverse the button and tooltip position

Bug

-Shadow Box during the fade in

ChangeLog:

  • Add Shadow on the button
  • Implemented button on right position