Zephora UI

Other

Fab

Floating action button fixed to a viewport corner (or rendered inline with position="static"). Provide a label (extended mode) or an aria-label so it always has an accessible name.

Import

import { Fab } from "@zephora/react";

Examples

Sizes

The demos use `position="static"` so the button stays in the canvas; by default it floats at the bottom-end of the viewport.

Extended and colors

Passing `label` switches to extended mode and names the button.

Floating placement

In an app you would omit `position` (defaults to "bottom-end") and tune the viewport gap with `offset`.

Imagine this box is the viewport

API

Fab props

PropTypeDefaultDescription
icon *ReactNodeIcon rendered inside the button.
labelstringExtended mode — shows the label next to the icon and names the button.
position"bottom-end" | "bottom-start" | "top-end" | "top-start" | "static""bottom-end"Where the button floats. "static" opts out of fixed positioning.
size"sm" | "md" | "lg""md"Diameter scale.
color"primary" | "danger" | "neutral""primary"Semantic color.
offsetnumber24Distance in px from the viewport edges (floating positions only).
unstyledbooleanfalseHeadless mode — skips Zephora styling.
…restButtonHTMLAttributes<HTMLButtonElement>All native button props (onClick, disabled…) are forwarded.