Fab

Floating action button, filled or glass, that can stretch into a labelled pill, show a spinner while work finishes, and mark an active state with a soft inner ring.

Preview

Installation

npx @lumioui/cli add fab

Usage

import { Fab } from "@/components/ui/fab/fab";
<Fab />

Examples

Extended

A "New note" pill parked over a notes list.

Glass disc

A photo viewer: the save action floats as a glass disc over the image (glass earns its place on imagery).

Quick Actions

Circular FABs as live-workout controls: a 56pt pause/resume flanked by 44pt lap and lock minis.

API reference

Prop Type Default
icon* React.ReactNode

Icon rendered inside the button.

—
extended boolean

Extended pill variant: icon + label.

false
label string

Label shown when extended is true.

—
size "sm" | "md"

Footprint: "md" (56pt, the default) or "sm" (44pt mini for dense toolbars / secondary surfaces).

"md"
position "bottom-right" | "bottom-left" | "none"

Position helper. "bottom-right" (default) applies absolute placement above the home indicator; "none" leaves placement to you.

"bottom-right"
haptic "light" | "medium" | "heavy" | false

Haptic style on press. Default "medium"; false to disable.

"medium"
loading boolean

Crossfade to a spinner and block presses while true.

false
glass boolean

Lumio glass surface — the button floats as a glass disc over content instead of a filled primary blob.

false
asyncTracking boolean

Auto-track async onPress — when onPress returns a Promise, the button automatically enters loading state until it resolves. Default true.

true
onPress
(e: GestureResponderEvent) => void … (e: GestureResponderEvent) => void | Promise<unknown>

Called on press. May return a Promise — tracked by asyncTracking.

—
lit boolean

Held state shown as light: an inner ring brightens once, then holds lit while true (a paused session, a recording armed). Default false.

false
className string —