IconButton
Square, icon-only button with a required accessible label
Category: inputs · WCAG 2.2-AA · action, icon, compact, toolbar
Variants
- ghost
- outline
- filled
Sizes
- sm
- md
- lg
States
- idle
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Text label for the control. |
ariaLabel | string | — | Alias for `label` (the catalog convention for an invisible accessible name). Both work; pass exactly one. |
icon | React.ReactNode | — | Icon element rendered in the component. |
variant | 'ghost' | 'outline' | 'filled' | ghost | Selects the visual style variant. |
size | 'sm' | 'md' | 'lg' | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
asChild | boolean | false | When true, renders the child element as the root via Slot, merging props (polymorphic rendering). |
disabled | boolean | false | When true, disables the control and removes it from the tab order. |
onClick | React.MouseEventHandler<HTMLButtonElement> | — | Called when the element is clicked. |
Design tokens
--cascivo-control-height-sm--cascivo-control-height-md--cascivo-control-height-lg--cascivo-button-radius--cascivo-radius-control--cascivo-color-primary--cascivo-color-primary-fg--cascivo-color-bg-subtle--cascivo-color-border--cascivo-color-surface--cascivo-focus-ring
When to use
- A compact, recognizable action where an icon alone communicates intent (close, edit, more)
- Dense toolbars or table rows where a text label would not fit
When not to use
- The action is not universally recognizable by its icon — use a Button with a text label
- Navigating between pages — use an anchor (optionally via asChild)
How to build an accessible IconButton in React →
Examples
Ghost
<IconButton label="Settings"><GearIcon /></IconButton>Filled
<IconButton label="Add" variant="filled" icon={<PlusIcon />} />As link
<IconButton label="Home" asChild><a href="/"><HomeIcon /></a></IconButton>Related components
- Button — Use a Button when the action needs a visible text label
- ButtonGroup — Icon buttons are commonly joined into a toolbar via ButtonGroup