Skip to main content

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.

Base
Mantine + override
Import
{ ActionIcon } from '@mantine/core'
Source
src/themes/theme.ts
src/themes/style-overrides/action-icon.module.css

Usage​

variant
size
sm
md
lg
disabled
React
<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.

React
<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>
VariantUse it for
primaryUse for the most important icon action in a section, toolbar, card, or similar context.
secondaryUse for supporting icon actions, often alongside a related primary action. Suitable when the action should be visible without competing with the primary action.
flatUse for less prominent or frequently repeated actions, such as actions in toolbars, rows, tables, and cards.
neutralActionIcon 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.

React
<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.

PropertyTypeAllowed valuesDefaultDescription
variantstringprimary · secondary · flat · neutral · primary-danger · secondary-danger · flat-dangerprimaryControls the visual treatment and emphasis. neutral is ActionIcon only; the others are shared with Button.
sizeMantineSizesm · md · lgmdSets 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.