How to build an accessible IconButton in React

Renders a native <button> with a mandatory aria-label so the icon-only control always exposes an accessible name; focus, role, and Enter/Space activation come from the platform

When to use a IconButton

When not to use it

Keyboard interactions

Role button, verified at WCAG 2.2-AA.

Common mistakes

Avoid: <IconButton label=""><TrashIcon /></IconButton>

Prefer: <IconButton label="Delete item"><TrashIcon /></IconButton>

An icon-only control has no visible text, so the label prop is the only accessible name screen readers can announce

Example

<IconButton label="Settings"><GearIcon /></IconButton>

See the full IconButton reference →