ActionIcon
A compact button that triggers an action using an icon without a visible label. ActionIcon follows the same height scale as Button and supports the same variants, plus one variant unique to ActionIcon.
Usage
<ActionIcon variant="primary" size="md" aria-label="Slett">
<IconTrash />
</ActionIcon>
Variants
ActionIcon variants follow the same visual hierarchy as Button, with primary, secondary and flat serving the same general purposes. Neutral is specific to ActionIcon and is intended for actions that should remain visually understated until interaction.
<ActionIcon variant="primary" aria-label="Slett">
<IconTrash />
</ActionIcon>
<ActionIcon variant="secondary" aria-label="Rediger">
<IconPencil />
</ActionIcon>
<ActionIcon variant="flat" aria-label="Vis mer">
<IconDotsVertical />
</ActionIcon>
<ActionIcon variant="neutral" aria-label="Lukk">
<IconX />
</ActionIcon>
| Variant | Use it for |
|---|---|
primary | Use for the most important icon action in a section, toolbar, card, or similar context. |
secondary | Use for supporting icon actions, often alongside a related primary action. Suitable when the action should be visible without competing with the primary action. |
flat | Use for less prominent or frequently repeated actions, such as actions in toolbars, rows, tables, and cards. |
neutral | ActionIcon only. The button remains visually neutral until hover or press, making it suitable for compact interfaces and secondary controls. |
Danger
Primary, secondary and flat each have a danger counterpart with the same emphasis, for an action that deletes something or cannot be undone.
<ActionIcon variant="primary-danger" aria-label="Slett">
<IconTrash />
</ActionIcon>
<ActionIcon variant="secondary-danger" aria-label="Slett">
<IconTrash />
</ActionIcon>
<ActionIcon variant="flat-danger" aria-label="Slett">
<IconTrash />
</ActionIcon>
Props
Only what this design system changes. Everything else is Mantine's.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
variant | string | primary · secondary · flat · neutral · primary-danger · secondary-danger · flat-danger | primary | Controls the visual treatment and emphasis. neutral is ActionIcon only; the others are shared with Button. |
size | MantineSize | sm · md · lg | md | Sets the width and height — 32, 40 or 48px. |
Read the full props table there.
Accessibility
An ActionIcon has no visible label — the icon is all a sighted user sees,
and on its own it is not an accessible name. Every ActionIcon needs an
aria-label naming the exact thing it acts on. A generic label breaks down
fast: in a list of rows that each have their own delete action,
aria-label="Slett" is ambiguous to someone tabbing through twenty identical
buttons, while an aria-label built from the row's own data — for example
Slett ${rad.navn} — names the one this button acts on.
A Tooltip carrying the same text helps a sighted user who hovers, but it
does not substitute for the aria-label — the accessible name still has to
live on the ActionIcon itself.
Focus behaviour, the disabled state and contrast are theme-wide: see Accessibility.