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.ReactNode—The main icon
ariaLabelstring—Alias of `label` — the same invisible accessible name under the catalog spelling. Neither is deprecated.
labelstring—Accessible 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() => void—Called 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.
openboolean—Whether the component is open (controlled).
defaultOpenboolean—Whether the component is open on first render (uncontrolled).
onOpenChange(open: boolean) => void—Called with the next open state when it changes.
classNamestring—Additional 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