Skip to main content

Fab

A circular, elevated floating action button (extended when given a label).

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

A circular, elevated floating action button (extended when given a label).

Accessibility​

Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.

Install and import​

npx shadcn@latest add @prism/fab
import { Fab } from '@/components/prism/Fab';

In a no-build prototype, read it from the bundle instead: const { Fab } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
variant"accent" | "neutral" | "positive" | "negative"—Fill colour. accent (default), neutral, or semantic positive/negative.
size"sm" | "md" | "lg"—
iconReact.ReactNode—The icon node (Lucide <svg>).
labelReact.ReactNode—Optional text — present = extended (pill) FAB.
isDisabledboolean—
onPress(e: React.MouseEvent) =&gt; void—REQUIRED when there is no visible label.
onClick(e: React.MouseEvent) =&gt; void—
classNamestring—