Alert
Displays a message with optional title and description for the user.
Heads up!
You can add components to your app using the shadcn CLI.
Something went wrong
Your session has expired.
Installation
Bash
Usage
Examples
With action
AlertAction pins a control — a dismiss button, an undo — to the
alert’s top-right corner.
Backup completed
Snapshot stored two minutes ago.
Conversation deleted
This action can be reverted.
API reference
Alert
Extends div with role="alert". A direct svg child becomes the
leading icon spanning both text rows.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "destructive" | "default" |
AlertTitle, AlertDescription, AlertAction
Structural wrappers extending div. AlertAction pins its content
(typically a small button) to the alert’s top-right corner.