Button
A Button is an interactive component used to trigger actions or events. It helps users perform tasks such as submitting forms, saving changes, or navigating to other pages.
Usage
Use buttons to communicate actions users can take and to allow users to interact with the page. Each page or section should have one primary button and any remaining calls to action should be represented as lower emphasis buttons.
<Button variant="primary" size="md">Lagre</Button>
Variants
Button has three variants, from highest to lowest emphasis.
<Button variant="primary">Lagre</Button>
<Button variant="secondary">Avbryt</Button>
<Button variant="flat">Se detaljer</Button>
| Variant | Use it for |
|---|---|
primary | The one action the view exists for. One per view. |
secondary | The alternative beside a primary — cancel, back. |
flat | Actions inside rows, toolbars and cards. |
Danger
Each variant has a danger counterpart with the same emphasis, for an action that deletes something or cannot be undone.
<Button variant="primary-danger">Slett</Button>
<Button variant="secondary-danger">Slett</Button>
<Button variant="flat-danger">Fjern</Button>
Props
Only what this design system changes. Everything else is Mantine's.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
variant | string | primary · secondary · flat · primary-danger · secondary-danger · flat-danger | primary | Controls the visual treatment and emphasis. |
size | MantineSize | sm · md · lg | md | Sets the button height — 32, 40 or 48px. Font size, horizontal padding and the 96px minimum width stay the same in every size. |
radius | MantineRadius | number | xs · sm · md · lg · xl · round · number | sm | Rounds the corners. The default is 5px. |
leftSection / rightSection | ReactNode | — | — | Content beside the label. Icons auto-size per button size — 16 / 18 / 20px at sm / md / lg — and the gap is spacing.sm. |
Read the full props table there.
Accessibility
Icon-only actions are ActionIcon, not a Button with no label — and they need
an aria-label naming the thing they act on.
A danger variant does not carry its meaning by colour alone — the label names the action, such as Slett.
Focus behaviour, the disabled state and contrast are theme-wide: see Accessibility.