Skip to content
GitHub

Alert

Displays an alert for user attention.

Heads up!
You can add icons to alerts to provide visual context and improve user experience.

Installation

Usage

Variants

The variant prop controls the alert's visual style.

Default

Deployment successful
You can now start building your next great project.

Info

New update available
A new update is available. Check it out now.

Warning

Storage almost full
Your storage is almost full. Consider upgrading your plan to avoid losing data.

Success

Payment successful
Your payment has been processed successfully. You will receive a receipt in your email.

Destructive

Session expired
Your session has expired. Please log in again.

Examples

With icon

Icons can be added to alerts for visual context and improved user experience.

New Feature Available
Icons can be added to alerts to provide visual context and improve user experience.

With action

New update available
Check it out now.

Custom color

Fancy alert, huh?
This is a fancy alert with a custom color.

API Reference

Alert

Root wrapper for alert messages. Supports variants (info, warning, etc.).

AlertTitle

Alert title or heading. Bold by default.

AlertDescription

Alert body or description. Muted foreground for hierarchy.

AlertAction

Holds action buttons (e.g. dismiss, retry).