FAB
The floating action button holds the single most important action on a screen. Use one per screen, at most.
Install
npx shadcn@latest add @nelumbo/fabColors
Neutral container by default, the accent container inside a dynamic color scope. Brand always uses the accent container; solid is black (white in dark mode), for when the action must stand out against busy content.
Sizes
Small (40) for compact layouts, default (56), and large (96) for a hero action on big screens. Corners tighten while pressed.
Extended
An extended FAB shows its label. Scroll the inbox: it collapses to the icon while you scroll down and opens again when you scroll up.
- Ines Moreau9:00Revised floor planI moved the pantry wall 40 cm east so the island fits.
- Tomás Reyes10:10Invoice 2026-114Attached. Net 30 as usual, thanks for the quick turnaround.
- Priya Natarajan11:20Thursday standupCan we push to 10:30? I have a site visit at 9.
- Jonas Berg12:30Tile samplesThe matte grey arrived. The terracotta is back-ordered until December.
- Hana Sato13:40Permit updateThe city approved the window change. Stamped drawings attached.
- Leo Martins14:50Lighting planTwo options for the hallway. I lean towards the recessed one.
- Ines Moreau15:00Re: Revised floor planWorks for me. Can you check the clearance to the fridge?
- Ines Moreau16:10Revised floor planI moved the pantry wall 40 cm east so the island fits.
- Tomás Reyes9:20Invoice 2026-114Attached. Net 30 as usual, thanks for the quick turnaround.
- Priya Natarajan10:30Thursday standupCan we push to 10:30? I have a site visit at 9.
- Jonas Berg11:40Tile samplesThe matte grey arrived. The terracotta is back-ordered until December.
- Hana Sato12:50Permit updateThe city approved the window change. Stamped drawings attached.
- Leo Martins13:00Lighting planTwo options for the hallway. I lean towards the recessed one.
- Ines Moreau14:10Re: Revised floor planWorks for me. Can you check the clearance to the fridge?
Usage
<Fab icon="edit" label="Compose" extended={!scrollingDown} className="fixed right-6 bottom-6" />Props
| Prop | Type | Default | Notes |
|---|---|---|---|
icon | IconName | required | |
label | string | required | Visible when extended; accessible name always |
extended | boolean | false | Animates the label in and out |
color | "auto" | "primary" | "secondary" | "brand" | "surface" | "solid" | "auto" | auto: neutral container, the accent container inside a dynamic scope |
size | "sm" | "default" | "lg" | "default" | 40, 56, 96 px |