Basic Floating Action Button
A round, fixed icon button for the one action a screen is really about - with a ring that survives any backdrop.
6 frameworksBeginner
A pill-shaped FAB carrying its icon and a visible label, for when the action needs saying out loud.
<!--
The visible label IS the accessible name here, so there is no aria-label to
keep in sync - and no chance of the two drifting apart. That is the reason to
reach for an extended FAB over a round one whenever you have the width.
-->
<button class="fab-ext" type="button">
<svg class="fab-ext__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false">
<path d="M12 5v14M5 12h14" />
</svg>
New invoice
</button>| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | - | Accessible label announced while loading. |
icon | ReactNode | - | Icon element rendered alongside the content. |
onClick | () => void | - | Fired when the user activates the control. |
disabled | boolean | false | Prevents interaction and dims the control. |
className | string | - | Additional classes merged onto the root element. |
The reason to reach for this over the round one is not shape, it is that the label is *visible text* - which makes it the accessible name automatically. There is no `aria-label` to write, therefore no `aria-label` to forget to update when "New invoice" becomes "New estimate". Two strings cannot drift when there is only one. Keep the icon `aria-hidden`: it repeats the label, and a screen reader announcing "plus New invoice" is noise. Budget the width honestly - an extended FAB is `auto`-width and a long label will happily run under a phone's edge; two words is the working limit, and if you need three you probably need a toolbar. Below `sm` many designs swap this for the round variant, which is a `hidden sm:inline-flex` on one and the inverse on the other.