Skip to content

Actions

Button

Five variants, three sizes, link or button element, with ripple, state layer and press feedback built in.

Button IconButton ButtonGroup Fab
import { Button, IconButton, ButtonGroup, Fab } from '@anomalia/ui';

Notes

  • Passing href renders an <a> that keeps every visual state — never wrap a Button in a link.
  • loading keeps the button at full contrast and swaps the label for a spinner without changing its width.
  • IconButton keeps a ≥44px hit area even at size="sm", via a transparent overlay.

Examples

Variants

Five variants covering the whole hierarchy of a screen: one primary action, everything else quieter.

Sizes and state

Sizes, icon slots, loading and link rendering. A loading button keeps its width and stays at full contrast.

Tokens

Fab

The FAB is the one unapologetically Material component. Extended mode animates its label open; `hidden` ducks it out of the way on scroll.

Simulates a scroll-away

API

Button

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'outline' | 'ghost' | 'danger''primary'Visual weight.
size'sm' | 'md' | 'lg''md'Control height: 32 / 40 / 48px.
hrefstringRenders an anchor instead of a button.
loadingbooleanfalseShows a spinner and blocks activation.
fullWidthbooleanfalseStretch to the container width.
pillbooleanfalseFully rounded ends.
leading / trailingSnippetIcon slots either side of the label.

IconButton

PropTypeDefaultDescription
labelstringRequired — the accessible name.
variant'solid' | 'soft' | 'outline' | 'ghost''ghost'Visual weight.
roundbooleantrueCircular rather than rounded-square.

Fab

PropTypeDefaultDescription
labelstringPresence of a label makes the FAB extended.
floatingbooleanfalsePin above the safe area, bottom-right.
hiddenbooleanfalseSlide off-screen — drive from scroll direction.

Every component also forwards the native attributes of its root element, plus class, so anything not listed here still works.