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
labelstringText label for the control.
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'ghostSelects the visual style variant.
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