Skip to main content

MultinaireFloatingActionButton

Floating action button (FAB) for primary screen actions.

Basic Usage

import { MultinaireFloatingActionButton } from '@multinaire/multinaire-design';

<MultinaireFloatingActionButton
icon="Plus"
title="Add"
onPress={() => {}}
/>

Props

PropTypeDefaultDescription
titlestringButton label text
iconIconNameIcon name displayed alongside the title
reversedbooleanfalseWhen true, the icon is placed after the title instead of before
position'left' | 'center' | 'right''right'Horizontal alignment of the FAB. Defaults to 'right'
widthnumberFixed width of the FAB
heightnumberFixed height of the FAB
marginSpacingPropsOuter margin
animatebooleanfalseWhen true, applies an entrance animation when the button mounts
isLoadingbooleanfalseShow a loading animation and disable the button
onPress() => voidPress 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>