docs / sula / sula-fab

SulaFab

a speed dial whose actions are liquid beads: each necks off the trigger, travels to its slot on a thinning thread, and settles. it collapses to a plain stacked menu under reduced motion.

intensity · assertsrsc · client

provenance

authored in usva

layer

sula

intensity

asserts · one per region. it is the focal point

composition

the page's one primary action with a few close relativesactions with href render as real anchors when the action navigatesnot for toolbars or a dozen commands. a plain menu reads fasterone sula per region. it never shares a corner with SulaNav

a11y

the trigger carries aria-expanded and aria-haspopup · closed actions are inert · open focuses the first action, Escape returns focus to the triggerjest-axe

dependencies

motion · ogl · sula-core and sula-motion from the same package
live demo · try it out
customize
labelthe trigger's accessible name
layoutstack along a line or fan an arc
directionwhich way a line opens
tooltipPositiontooltip side; auto is left for lines, top for arcs
gapedge gap in px between trigger and beads
12
fluidoff renders the plain stacked menu
shine0 matte glass, 1 full neon rim
0.7
usagecopy
import { SulaFab } from "@usva-ui/react/sula/sula-fab";

<SulaFab
  label="Create"
  actions={actions}
/>

props

proptypedefaultnotes
actionsSulaFabAction[]{ icon, label, onClick?, href? } each. beads are icon-only; the label is the accessible name and the tooltip.
iconReactNodea plusthe trigger glyph.
labelstring"Actions"the trigger's accessible name.
open / defaultOpenbooleanfalsecontrolled and uncontrolled open state.
onOpenChange(open: boolean) => voidfires on toggle, Escape, or an action.
layout"line" | "arc""line"line stacks the beads along direction; arc fans them upward.
direction"up" | "down" | "left" | "right""up"which way a line layout opens.
tooltipPosition"left" | "right" | "top"where action tooltips sit. left for line, top for arc.
gapnumber12constant edge gap in px between trigger and beads. raise it for touch.
fluidbooleantruefalse renders a plain stacked menu and mounts no canvas.
backdrop / tint / accentColorstringthe glass palette. default to the bg, surface-2 and accent tokens.
shinenumberper backdrop0 is flat matte glass, 1 is the full neon rim.

get it

bun add @usva-ui/reactcopy
usagecopy
import { SulaFab } from "@usva-ui/react/sula/sula-fab";

<SulaFab
  label="Create"
  actions={[
    { icon: <PlusIcon />, label: "New note", onClick: newNote },
    { icon: <MailIcon />, label: "Message", href: "/compose" },
  ]}
/>