Home

Awesome

react-native-fab

A FAB button component for Android and iOS, customizable, simple and as per material design specs.

FAB demo with snackbar

See Google Material Design for more info on FABs.

Installation

npm install --save react-native-fab

Basic Usage

import FAB from 'react-native-fab'

Code

<FAB buttonColor="red" iconTextColor="#FFFFFF" onClickAction={() => {console.log("FAB pressed")}} visible={true} iconTextComponent={<Icon name="all-out"/>} />

Options

PropTypeEffectDefault Value
visiblebooleanShow or hide the FABtrue
buttonColorstringThe color of FABred
onClickActionfunctionFunction to be called when button is pressed()=>{}
iconTextColorcolorThe color of icon of FAB#FFFFFF
iconTextComponentcomponentText component or any other component based on it, works great with Icon from react-native-vector-icons<Text>+</Text>
snackOffsetnumberThe amount by which to move up the FAB to accomodate snackbar0

Note