IconButton

Square, icon-only button with a required accessible label

Category: inputs · WCAG 2.2-AA · action, icon, compact, toolbar

Variants

Sizes

States

Props

PropTypeDefaultDescription
labelstringAccessible name for the icon-only button. Not rendered — screen readers only; `ariaLabel` is the same thing under the catalog name.
ariaLabelstringAlias for `label` (the catalog convention for an invisible accessible name). Both work; pass exactly one.
iconReact.ReactNodeIcon element rendered in the component.
variant'ghost' | 'outline' | 'filled'ghost`ghost` is transparent until hover, `outline` adds a border, `filled` gives the button a solid surface.
size'sm' | 'md' | 'lg'mdVisual size of the component (e.g. 'sm', 'md', 'lg').
asChildbooleanfalseWhen true, renders the child element as the root via Slot, merging props (polymorphic rendering).
disabledbooleanfalseWhen true, disables the control and removes it from the tab order.
onClickReact.MouseEventHandler<HTMLButtonElement>Called when the element is clicked.

Design tokens

When to use

When not to use

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

← Back to docs