Use when
- Toolbars and top bars where text buttons crowd
- Row actions too narrow for a label
- Toggle actions that show a pressed state
Runs an action from an icon alone, for toolbars and table rows.
Icon carries the action; the label lives in aria-label.
Cloud Registry requires a workspace key and installs verified source with a lockfile. In Fragments Cloud, open Settings, then Repositories, then Open MCP setup beside Workspace key. Store the full key in a password manager or CI secret and never commit it.
npm install -D @usefragments/cli
npx @usefragments/cli registry add IconButton --to src/fragments/ui --import-path "@/fragments/ui"
npx @usefragments/cli registry statusIf status reports drift, inspect it with registry diff and restore managed source with registry sync.
import { IconButton } from "@/fragments/ui";Rising chrome: transparent, tinted, then bordered.
sm for table rows, lg for primary chrome.
Toggle that stays on, reported through aria-pressed.
Unavailable action, out of the tab order.
Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | node | Not set | Icon element rendered inside the button |
variant | enumghostsubtleoutlined | ghost | Visual treatment for the icon-only action |
size | enumsmmdlg | "md" | Control size aligned with adjacent fields and toolbar actions |
pressed | boolean | Not set | Marks a toggle-style action as pressed and sets aria-pressed |
aria-label | string | Not set | Accessible action name when no labelled-by relationship is available |
aria-labelledby | string | Not set | ID reference for an external accessible action label |
type | enumsubmitresetbutton | button | — |