Skip to content

FAB

FAB

{/* Icon-only, default position */}
<FAB aria-label="New post" icon={<PlusIcon />} />
{/* Extended */}
<FAB extended icon={<PlusIcon />} onClick={open}>New</FAB>
{/* Manually placed */}
<FAB positioned={false} aria-label="Capture" icon={<CameraIcon />} />

Install: @helixui/core

import { FAB } from '@helixui/core'

status: stable · since: 0.5.0

Tags: mobile, floating, primary-action, circular

Anatomy

…page content…
╭─╮
│+│ ← circular FAB
╰─╯

Layout

  • displayfixed
  • widthcontent
  • heightcontent
  • intrinsicSize~56px circle (default), or pill in extended
  • stackablefalse
  • fullBleedfalse

Visual

A circular brand-colored button with a centered icon, fixed to the bottom-right with safe-area padding. The extended variant becomes a pill with icon + label. Uses shadow.lg for lift.

Props

NameTypeDefaultDescription
aria-labelstringRequired accessible name when icon-only (no extended label).
tone'brand' | 'neutral' | 'danger'brandColor intent.
size'sm' | 'md' | 'lg'mdDiameter / pill height — 40 / 56 / 64 px.
extendedbooleanfalseRender as a pill with icon + label child.
positionedbooleantrueFixed-position at bottom-right with safe-area inset; set false to place manually.
iconReactNodeIcon content.

Slots

  • children — used as label only when extended

Tokens used

color.bg.action.brand.default, color.bg.action.brand.hover, color.bg.action.danger.default, color.bg.action.danger.hover, color.bg.action.neutral.default, color.bg.surface.default, color.text.on.brand, color.text.on.danger, color.text.primary, color.border.default, color.border.focus, radius.full, space.2, space.4, space.5, font.family.sans, font.size.sm, font.size.md, font.weight.semibold, shadow.lg

Accessibility

Role: button

Notes

  • Always provide aria-label for the icon-only variant — the screen reader has no visible text.
  • Default placement adds bottom: var(--helixui-space-4) + env(safe-area-inset-bottom) so the FAB clears the iOS home indicator and any BottomNav.

Composes with

ComponentRelationNote
SafeAreaparentWrap on mobile builds for inset.
IconButtonalternativeIconButton stays inline; FAB floats.
BottomNavsibling
ActionSheetsibling

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

compose new email

“a floating + button in the bottom-right”

<FAB icon={<PlusIcon />} aria-label="Compose" onPress={compose} />

extended FAB with label

“pill-shaped FAB saying “New post""

<FAB extended icon={<PlusIcon />}>New post</FAB>