Docyrus

Fab

Floating action button with ActionSheet menu, position control, and variant colors.

iOSAndroid
Preview Fab on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-fab
Required Packages(1 package)
pnpm add react-native-reanimated

Usage

import { Fab } from '@/components/docyrus-native/fab';

<Fab onPress={() => console.log('pressed')} />
<Fab label="Add" variant="primary" position="bottom-right" />
<Fab
  variant="secondary"
  items={[
    { label: 'Camera', onPress: () => {} },
    { label: 'Gallery', onPress: () => {} },
  ]}
/>

API Reference

PropTypeDefaultDescription
onPress() => void—Press handler (when no items provided)
labelstring—Extended label text next to icon
iconReactNode—Custom icon element
position'bottom-right' | 'bottom-left' | 'top-right' | 'top-left''bottom-right'Screen position
size'sm' | 'md' | 'lg''md'Button size
variant'primary' | 'secondary' | 'success' | 'warning' | 'destructive''primary'Color variant
disabledbooleanfalseDisabled state
itemsFabItem[]—Menu items (opens ActionSheet when pressed)
menuTitlestring—Title for the ActionSheet menu
classNamestring—Additional CSS classes
textClassNamestring—Label text CSS classes

FabItem

PropTypeDescription
labelstringMenu item label
iconReactNodeMenu item icon
onPress() => voidMenu item press handler

Type Exports

TypeDescription
FabPropsProps for Fab component
FabItemMenu item configuration object
FabSize'sm' | 'md' | 'lg'
FabPosition'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
FabVariant'primary' | 'secondary' | 'success' | 'warning' | 'destructive'

On this page