IconButton

Runs an action from an icon alone, for toolbars and table rows.

Installation

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 status

If status reports drift, inspect it with registry diff and restore managed source with registry sync.

Usage

import { IconButton } from "@/fragments/ui";

Variants

Rising chrome: transparent, tinted, then bordered.

Loading preview…

Sizes

sm for table rows, lg for primary chrome.

Loading preview…

Pressed state

Toggle that stays on, reported through aria-pressed.

Loading preview…

Disabled

Unavailable action, out of the tab order.

Loading preview…

Usage guidance

Use when

  • Toolbars and top bars where text buttons crowd
  • Row actions too narrow for a label
  • Toggle actions that show a pressed state

Avoid when

  • The action needs a visible label — use Button
  • It flips a persistent setting — use Switch
  • The icon is decorative — use Icon

Standards references

API Reference

IconButton

Component props
Prop
Type
Default
Description
childrenRequirednodeNot setIcon element rendered inside the button
variantenumghostsubtleoutlinedghostVisual treatment for the icon-only action
sizeenumsmmdlg"md"Control size aligned with adjacent fields and toolbar actions
pressedbooleanNot setMarks a toggle-style action as pressed and sets aria-pressed
aria-labelstringNot setAccessible action name when no labelled-by relationship is available
aria-labelledbystringNot setID reference for an external accessible action label
typeenumsubmitresetbuttonbutton

Next steps