Alert
Inform users about important changes or conditions in the interface in a prominent way.
Base
Mantine + override
Mantine
Import
{ Alert } from '@mantine/core'
Source
src/themes/component-overrides/feedback.ts
src/themes/style-overrides/alert.module.css
Usage
variant
Text Alignment (TA)
title
withCloseButton
React
<Alert variant="info">
Endringene er lagret.
</Alert>
Variants
The theme adds four status variants.
React
<Alert variant="neutral">Nøytral melding.</Alert>
<Alert variant="info">Informasjon til brukeren.</Alert>
<Alert variant="warning">Sjekk input før du fortsetter.</Alert>
<Alert variant="error">Noe gikk galt.</Alert>
Mantine's own variants (filled, light, outline, default, transparent,
white) still resolve normally — the four above are additions, not
replacements.
Props
Only what this design system changes. Everything else is Mantine's — read the full props table there.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
variant | string | neutral · info · warning · error | light | Selects the status treatment. The four values are additions to Mantine's variants. The theme sets no default. |
radius | MantineRadius | number | — | xs | Rounds the corners to 3px, overriding the theme's own global default of sm (5px). |
ta | CSSProperties['textAlign'] | center · left | center | Aligns the title and the message together. Mantine's own style prop; the theme changes its default from left to centred. |
title | ReactNode | — | — | Heading shown above the message. Omit it for a message-only alert. |
children | ReactNode | — | — | The message body. Padded spacing.xl inline; the title carries the same inline padding. |
icon | ReactNode | — | — | Leading icon. No icon is shown by default, and the theme does not tint a supplied one by variant. |
Accessibility
- The root element carries
role="alert"by default — an assertive live region. Screen readers announce the content as soon as it mounts, with no need for focus. Reserve it for messages that genuinely need that interruption. aria-describedbypoints at the message body, andaria-labelledbyat the title when one is set — both wired automatically by Mantine.withCloseButtonhas no default label. SetcloseButtonLabelwhenever you turn it on, as the Usage demo above does.
See Accessibility for the theme-wide rules.