Skip to main content

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.

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

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.

variant
size
sm
md
lg
disabled
leftSection
React
<Button variant="primary" size="md">Lagre</Button>

Variants​

Button has three variants, from highest to lowest emphasis.

React
<Button variant="primary">Lagre</Button>
<Button variant="secondary">Avbryt</Button>
<Button variant="flat">Se detaljer</Button>
VariantUse it for
primaryThe one action the view exists for. One per view.
secondaryThe alternative beside a primary — cancel, back.
flatActions 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.

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

PropertyTypeAllowed valuesDefaultDescription
variantstringprimary · secondary · flat · primary-danger · secondary-danger · flat-dangerprimaryControls the visual treatment and emphasis.
sizeMantineSizesm · md · lgmdSets the button height — 32, 40 or 48px. Font size, horizontal padding and the 96px minimum width stay the same in every size.
radiusMantineRadius | numberxs · sm · md · lg · xl · round · numbersmRounds the corners. The default is 5px.
leftSection / rightSectionReactNode——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.