Alert
An inline message about the state of the page or a task.
Staticimport { Alert } from 'umbra-ui'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
dismissLabel | string | Dismiss | Accessible label for the dismiss button. |
icon | ReactNode | — | Replaces the default icon; pass `null` to hide it. |
onDismiss | (() => void) | — | When provided, shows a dismiss button that calls this handler. |
title | ReactNode | — | Short heading. |
tone | "accent" | "neutral" | "danger" | "success" | "warning" | "info" | info | Colour intent. `danger` and `warning` are announced assertively (`role="alert"`), others politely. |
variant | "soft" | "outline" | soft | Visual weight. |
Usage notes
For transient confirmations use Toast instead.
Accessibility
dangerandwarninguserole="alert"(announced immediately); other tones userole="status". Overriderolefor alerts present on page load.- The icon is decorative; tone is also conveyed by your text.
- The dismiss button has an accessible label (
dismissLabel).
Import
import { Alert } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app