MultinaireFloatingActionButton
Floating action button (FAB) for primary screen actions.
Basic Usage
import { MultinaireFloatingActionButton } from '@multinaire/multinaire-design';
<MultinaireFloatingActionButton
icon="Plus"
title="Add"
onPress={() => {}}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | Button label text |
icon | IconName | — | Icon name displayed alongside the title |
reversed | boolean | false | When true, the icon is placed after the title instead of before |
position | 'left' | 'center' | 'right' | 'right' | Horizontal alignment of the FAB. Defaults to 'right' |
width | number | — | Fixed width of the FAB |
height | number | — | Fixed height of the FAB |
margin | SpacingProps | — | Outer margin |
animate | boolean | false | When true, applies an entrance animation when the button mounts |
isLoading | boolean | false | Show a loading animation and disable the button |
onPress | () => void | — | Press handler. When omitted the button renders in a disabled (dimmed) state |
Examples
Basic FAB
<MultinaireFloatingActionButton
icon="Plus"
title="New"
onPress={() => createNew()}
/>
Icon Only FAB
<MultinaireFloatingActionButton
icon="Plus"
title=""
width={56}
height={56}
onPress={() => {}}
/>
Different Positions
// Right aligned (default)
<MultinaireFloatingActionButton
position="right"
icon="Plus"
title="Add"
onPress={() => {}}
/>
// Center aligned
<MultinaireFloatingActionButton
position="center"
icon="Camera"
title="Capture"
onPress={() => {}}
/>
// Left aligned
<MultinaireFloatingActionButton
position="left"
icon="Menu"
title="Menu"
onPress={() => {}}
/>
With Animation
<MultinaireFloatingActionButton
animate
icon="Plus"
title="Create"
onPress={() => {}}
/>
In a Screen Layout
<MultinaireContainer flex={1}>
<MultinaireListView data={items} renderItem={...} />
<MultinaireFloatingActionButton
icon="Plus"
title="Add Item"
onPress={() => navigation.navigate('AddItem')}
/>
</MultinaireContainer>