Notification
Notifications give users short feedback about an action or a change in the system, without interrupting what they are doing.
Usage
<Notification variant="info" title="Ny versjon tilgjengelig">
Oppdater siden for å ta i bruk endringene.
</Notification>
To show notifications as toasts, render Notifications from
@mantine/notifications once in the
app and call notifications.show(). The theme places them top-right. Import
@mantine/notifications/styles.css alongside the design system's stylesheet.
Variants
Du kan fortsette senere.
Oppdater siden for å ta i bruk endringene.
Endringene er lagret.
Ett felt mangler verdi.
Prøv igjen om litt.
<Notification variant="neutral" title="Utkast lagret">Du kan fortsette senere.</Notification>
<Notification variant="info" title="Ny versjon tilgjengelig">Oppdater siden for å ta i bruk endringene.</Notification>
<Notification variant="success" title="Lagret">Endringene er lagret.</Notification>
<Notification variant="warning" title="Kontroller innholdet">Ett felt mangler verdi.</Notification>
<Notification variant="error" title="Noe gikk galt">Prøv igjen om litt.</Notification>
The variant colours the left accent line and the icon; the background stays on
the surface colour. Supplying an icon hides the left accent line and tints
the icon to match — one shade darker for warning, and the default icon
colour for neutral. The icon renders at 32px.
Size
Notification has no size prop and fills its container. We recommend a minimum
width of 320px and a maximum width of 512px. Set them with CSS min-width and
max-width — through the miw and maw props, or a class of your own.
For toasts, set the width once with containerWidth on Notifications.
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 · success · warning · error | — | Selects the status colour. Not in Mantine's typed props. |
icon | ReactNode | — | — | Leading icon, tinted to match variant. Supplying one hides the left accent line. |
radius | MantineRadius | — | md | Rounds the corners to 8px. The theme's global default is sm (5px). |
withBorder | boolean | — | true | Draws a 1px border. Mantine's own default is off. |
Accessibility
- The root element carries
role="alert"by default, same asAlert. withCloseButtondefaults totrueon this component, so a close button renders unless you turn it off. Mantine's own guidance: give it anaria-label(ortitle) throughcloseButtonProps, or it ships silent to a screen reader — neither Mantine nor the theme supplies one for you.