Anchor
Displays a link. Stock Mantine Anchor that underlines under the pointer and
not at rest, with a wider gap between the text and the line than Mantine's own.
Usage
<Anchor href="#" underline="hover">Les mer</Anchor>
Props
Only what this design system changes. Everything else is Mantine's — read the full props table there.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
underline | AnchorProps['underline'] | always · hover · not-hover · never | hover | Controls when the underline is drawn. The default puts it under the pointer and never at rest — the same value Mantine ships, but stated in theme.ts so it is this system's decision rather than an inherited one. |
theme.ts also applies a static styles object on the root selector —
{ root: { textUnderlineOffset: 'var(--mantine-spacing-xs)' } } — not a
callback function and not a prop, so it isn't something a caller overrides
through props. --mantine-spacing-xs resolves to 4px, so whenever the
underline is shown (hover, always, or not-hover while not hovered) it
sits 4px below the baseline instead of Mantine's own offset.
Accessibility
The underline appears under the pointer, so at rest a link is set apart from the text around it by colour alone. WCAG 1.4.1 (Use of Color) is not one of the two criteria APCA replaces — it still applies unchanged — and it is the criterion this touches: its concern is a link the reader cannot pick out of a block of prose without seeing colour. A hover underline does not answer that, because the reader has to already suspect the link is there to hover it.
Where that is the case — an anchor inside a running text passage, rather than one
standing on its own in obviously-interactive UI (a nav, a button row, a table
cell) — set underline="always" at the call site. The default is chosen for the
second, far more common case in this system.
Check a non-default c colour against the
thresholds before shipping it.