Skip to main content

FAB

Inputs & Controls

FAB

Floating action button with primary and extended styles.

Usage

Expose the single most common creation action on a screen.

Highlights

  • Handles icon-only and extended label modes
  • Elevation + state layers baked in

When to use it

  • You need a persistent create shortcut.
  • Scrolling content should not hide call-to-action.

Examples

Default

Preview (Web)
import { FAB } from 'react-native-molecules/components/FAB';

export default function Example() {
  return <FAB iconName="plus" onPress={() => console.log('Create')} />;
}

Extended FAB

Preview (Web)
import { FAB } from 'react-native-molecules/components/FAB';

export default function Example() {
  return <FAB iconName="pencil-outline" label="Compose" onPress={() => console.log('Compose')} />;
}
PropTypeDefaultDescription
iconNameRequiredstringname of the icon
iconType"material-community" | "feather" | undefinedtype of the icon
iconPropsOmit<IconProps, "ref" | "name" | "type"> | undefinedicon component's props
labelstring | undefinedLabel of the FAB, if provided the FAB will be on extended mode
labelPropsOmit<Partial<TextProps>, "children"> | undefinedProps of the label
containerPropsOmit<SurfaceProps, "ref" | "style"> | undefinedProps for the surface container
innerContainerStyleViewStyle | undefinedProps for the innner touchable container
size"sm" | "md" | "lg" | undefinedsizes of the FAB
variantFABVariant | undefinedvariants of the FAB
elevationMD3Elevation | undefinedElevation level
stateLayerPropsViewProps | undefinedProps for the state layer
Defined in react-native-molecules/components/FAB