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
hrefrenders an<a>that keeps every visual state — never wrap a Button in a link. loadingkeeps 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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'primary' | Visual weight. |
size | 'sm' | 'md' | 'lg' | 'md' | Control height: 32 / 40 / 48px. |
href | string | — | Renders an anchor instead of a button. |
loading | boolean | false | Shows a spinner and blocks activation. |
fullWidth | boolean | false | Stretch to the container width. |
pill | boolean | false | Fully rounded ends. |
leading / trailing | Snippet | — | Icon slots either side of the label. |
IconButton
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Required — the accessible name. |
variant | 'solid' | 'soft' | 'outline' | 'ghost' | 'ghost' | Visual weight. |
round | boolean | true | Circular rather than rounded-square. |
Fab
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Presence of a label makes the FAB extended. |
floating | boolean | false | Pin above the safe area, bottom-right. |
hidden | boolean | false | Slide 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.