Alert
A message in the flow of the page.
An alert is a status region, so screen readers announce it when it appears. Pass
role="alert" for something that needs attention right away. An icon as the first child gets
its own column.
Dependencies
What it's built from and what's built from it in Base, read from the imports in its source.
| Uses | Textprimitive |
|---|---|
| Used by | Nothing yet. |
| Packages | tailwind-variants@4.1.0 |
Installation
Set the project up for Base once first, as Getting started shows. Then add it with the CLI, or by hand.
With the CLI
Manually
Install its packages:
Add the components it uses first, listed under Dependencies.
Then copy the source:
API reference
Generated from Base's types. Props marked ours are added here; the rest come from the ui-sdk part it wraps. Every part also accepts its element's native attributes.
Alert
A message in the flow of the page. It's a status region, read out when it appears; pass role="alert" for something urgent.
- variantours
Its tone.
destructiveandwarningtint the text, not the surface.Type NonNullable<"default" | "destructive" | "warning">
AlertAction
An action pinned to the alert's top-right corner, like a dismiss button.
Takes the props of a native div.
AlertDescription
The alert's body.
Takes the props of a native div.
AlertTitle
The alert's heading.
Takes the props of a native div.