FAB
A floating action button — an elevated, prominent circular (or extended, icon+label) button for a screen's primary action.
Playground
<Fab
icon={PlusIcon}
variant="solid"
size="lg"
onPress={() => {}}
/>
Icon-only and extended
<Fab icon={PlusIcon} onPress={() => {}} />
Create
<Fab icon={PlusIcon} label="Create" onPress={() => {}} />
Docked to a corner
Pass position to absolutely-position the FAB over its parent (the parent needs position: 'relative').
<Box style={{ position: 'relative', flex: 1 }}>
{/* screen content */}
<Fab icon={PlusIcon} position="bottomRight" onPress={() => {}} />
</Box>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
icon | TVajraIconComponent | Required. The FAB's icon. | |
label | string | Renders an extended FAB (icon + label) instead of an icon-only circle. | |
variant | 'solid' | 'subtle' | 'surface' | 'outline' | 'ghost' | 'plain' | 'solid' | Visual style (shares IconButton's recipe). |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'lg' | Button and icon size. |
isDisabled | boolean | false | Disables interaction and dims opacity. |
position | 'bottomRight' | 'bottomLeft' | 'topRight' | 'topLeft' | Docks the FAB to a corner of its (relatively-positioned) parent. | |
offset | number | 16 | Distance (px) from the two edges implied by position. |
Also accepts all Pressable props (bg, spacing, etc.) except disabled and position (used for docking above); use isDisabled instead.