Fab

Floating action button anchored to a screen corner, with an optional speed-dial of secondary actions

Category: inputs · WCAG 2.2-AA · inputs, fab, floating-action-button, mobile, speed-dial

States

Props

PropTypeDefaultDescription
childrenReact.ReactNodeThe main icon
ariaLabelstringAlias of `label` — the same invisible accessible name under the catalog spelling. Neither is deprecated.
labelstringAccessible name for the main button (it is icon-only). Not rendered — screen readers only. Exactly one of `label` / `ariaLabel` is required; the type enforces it.
onClick() => voidCalled when the element is clicked.
actionsFabAction[]Speed-dial actions; each has a label, icon, onSelect, and optional disabled
position'bottom-end' | 'bottom-start'bottom-endScreen corner the button is pinned to: `bottom-end` or `bottom-start`. Safe-area insets are honoured either way.
openbooleanWhether the component is open (controlled).
defaultOpenbooleanWhether the component is open on first render (uncontrolled).
onOpenChange(open: boolean) => voidCalled with the next open state when it changes.
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

How to build an accessible Fab in React →

Examples

Single action

<Fab label="Compose" onClick={compose}><PlusIcon /></Fab>

Speed dial

The main button toggles a menu of secondary actions.

<Fab
  label="Create"
  actions={[
    { label: 'New note', icon: <NoteIcon />, onSelect: newNote },
    { label: 'New folder', icon: <FolderIcon />, onSelect: newFolder },
  ]}
>
  <PlusIcon />
</Fab>

Start corner

<Fab label="Help" position="bottom-start" onClick={openHelp}><HelpIcon /></Fab>

Related components

← Back to docs