Alert
Feedback[atlasAlertDescription][atlasAlertTitle][atlasAlert]Examples
Variants
Put an atlas-icon first and it sits beside the title; the variant colours the border, tint and icon, while the text stays readable on every tint.
Dismissible
dismissible adds a close button that hides the alert and emits (dismissed) . The alert held focus on its close button, so the handler moves focus somewhere sensible.
Announcements
live sets how screen readers announce an alert: polite (default, role="status" ) waits its turn, assertive ( role="alert" ) interrupts for errors that need action, off is for messages that are part of the page from the start.
API
Generated from the library source, so it always matches the code.
AtlasAlertComponent [atlasAlert]
| Input | Type | Default | Description |
|---|---|---|---|
| variant | AlertVariants['variant'] | 'default' | default , info , success , warning or destructive . The title must also say the status: colour alone is not enough. |
| live | AlertLive | 'polite' | polite ( role="status" ), assertive ( role="alert" ) or off . |
| dismissible | boolean | false | dismissed . |
| dismissLabel | string | undefined | undefined | alert.dismiss text. |
| class | string | '' | cn() ; yours win on conflicts. |
| Output | Payload | Description |
|---|---|---|
| dismissed | void |
AtlasAlertTitleDirective [atlasAlertTitle]
| Input | Type | Default | Description |
|---|---|---|---|
| class | string | '' | cn() ; yours win on conflicts. |
AtlasAlertDescriptionDirective [atlasAlertDescription]
| Input | Type | Default | Description |
|---|---|---|---|
| class | string | '' | cn() ; yours win on conflicts. |
Types
AlertLive
polite ( role="status" ) waits for the screen reader to finish; assertive ( role="alert" ) interrupts, for errors that need action now; off sets no role, for a message that is part of the page from the start.
type AlertLive = 'polite' | 'assertive' | 'off'AlertVariants
type AlertVariants = VariantProps<typeof alertVariants>