Skip to content

FloatingActionButton

FAB promotes the primary action in an interface. Use for the most important action on a screen.

+

+
<FloatingActionButton
icon={<PlusIcon />}
onPress={handleAdd}
accessibilityLabel="Add new reading"
/>

+
sm
+
md
+
lg
<FloatingActionButton size="sm" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />
<FloatingActionButton size="md" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />
<FloatingActionButton size="lg" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />

+
primary
+
secondary
+
surface
<FloatingActionButton variant="primary" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />
<FloatingActionButton variant="secondary" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />
<FloatingActionButton variant="surface" icon={<PlusIcon />} onPress={handleAdd} accessibilityLabel="Add" />

FAB with a label for more context.

+New Reading
<FloatingActionButton
icon={<PlusIcon />}
label="New Reading"
onPress={handleAdd}
accessibilityLabel="Add new reading"
/>

FAB that expands to reveal additional actions.

Save Reading
💾
Share
🔗
New Cast
+
<SpeedDial
icon={<PlusIcon />}
actions={[
{ icon: <SaveIcon />, label: 'Save Reading', onPress: handleSave },
{ icon: <ShareIcon />, label: 'Share', onPress: handleShare },
{ icon: <CastIcon />, label: 'New Cast', onPress: handleCast },
]}
accessibilityLabel="Actions menu"
/>

PropTypeDefaultDescription
iconReactNodeRequiredIcon to display
labelstring-Label for extended FAB
size'sm' | 'md' | 'lg''md'Button size
variant'primary' | 'secondary' | 'surface''primary'Button variant
position'bottom-right' | 'bottom-left' | 'bottom-center''bottom-right'Screen position
onPress() => voidRequiredPress handler
disabledbooleanfalseDisabled state
styleViewStyle-Custom styles
accessibilityLabelstringRequiredScreen reader label
PropTypeDefaultDescription
iconReactNodeRequiredMain FAB icon when closed
openIconReactNode-Icon when open
actionsSpeedDialAction[]RequiredSpeed dial actions
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Open state handler
positionFABPosition'bottom-right'FAB position
accessibilityLabelstringRequiredScreen reader label