Skip to main content

Design Tokens

Design tokens are a tech-agnostic way to store variables. We use tokens instead of hard coded values to ensure a better UI consistency across different platforms.

Mantine's rem() helper emits calc(Nrem * var(--mantine-scale)) rather than a plain length, which is why each row shows the pixel value it resolves to at the default scale with the literal value underneath.

Spacing​

An eight-step scale on a 4/8 grid. Used for p, m, gap and by every component override.

KeyCSS variableValuePreview
xxs--mantine-spacing-xxs
2px
calc(0.125rem * var(--mantine-scale))
xs--mantine-spacing-xs
4px
calc(0.25rem * var(--mantine-scale))
sm--mantine-spacing-sm
8px
calc(0.5rem * var(--mantine-scale))
smd--mantine-spacing-smd
12px
calc(0.75rem * var(--mantine-scale))
md--mantine-spacing-md
16px
calc(1rem * var(--mantine-scale))
lg--mantine-spacing-lg
24px
calc(1.5rem * var(--mantine-scale))
xl--mantine-spacing-xl
32px
calc(2rem * var(--mantine-scale))
xxl--mantine-spacing-xxl
48px
calc(3rem * var(--mantine-scale))

Radius​

theme.defaultRadius is sm, so a component that says nothing about radius is 5px. round is the pill shape — a large fixed length rather than a percentage, so it stays a capsule at any height.

KeyCSS variableValuePreview
xs--mantine-radius-xs
3px
calc(0.1875rem * var(--mantine-scale))
sm--mantine-radius-sm
5px
calc(0.3125rem * var(--mantine-scale))
md--mantine-radius-md
8px
calc(0.5rem * var(--mantine-scale))
lg--mantine-radius-lg
16px
calc(1rem * var(--mantine-scale))
xl--mantine-radius-xl
32px
calc(2rem * var(--mantine-scale))
round--mantine-radius-round
9999px
calc(624.9375rem * var(--mantine-scale))

Type​

Font sizes, line heights, weights and letter spacing live on the Typography page, together with the heading sizes and the guidance on what each step is for.

Icon sizes​

Numeric, not a Mantine theme property — Tabler icons take size as a number for the SVG's width and height.

KeyValuePreview
xs8px
sm16px
smd20px
md24px
lg32px
xl48px

Buttons size their leftSection and rightSection icons independently of this scale — 16 / 18 / 20px at sm / md / lg — set in button.module.css.

Motion​

Three durations, in milliseconds. Exported as a JS constant because Mantine takes durations as numbers, and mirrored as --mantine-duration-* by the CSS variable resolver so a transition written in CSS and one handed to a component prop cannot drift apart.

KeyValueCSS variableFor
fast150ms--mantine-duration-fastControl states and dropdown transitions
base200ms--mantine-duration-baseShort travel — an indicator or thumb moving a small distance
slow300ms--mantine-duration-slowModal and Spotlight transitions

Shadows​

Five steps on Mantine's scale, plus one the design system adds. Shadows are scheme-neutral: the same values apply in dark mode.

xs

sm

md

lg

xl

modal

--mantine-shadow-modal is the lifted-surface shadow and is deliberately not part of the xs–xl scale: none of the five matched it, and overwriting one would have moved every other component that uses it.

Breakpoints​

In em, not rem or px — a media query in em responds to the user's browser font size, which px does not.

KeyCSS variableValue
xs--mantine-breakpoint-xs36em
sm--mantine-breakpoint-sm48em
md--mantine-breakpoint-md62em
lg--mantine-breakpoint-lg75em
xl--mantine-breakpoint-xl88em