GitHub

Alert

Displays a alert for user attention.

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

Installation

Basic usage

Variants

You can change the variant of the alert using the variant prop.

Solid

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

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

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

Custom color

You can use the className prop to customize the alert colors to match your design system.

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

With action buttons

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

API Reference

Alert

Root element of the alert. Renders a div

AlertTitle

Styled title of the alert. Renders a div

AlertDescription

Styled description with muted foreground text color. Renders a div

AlertAction

Container for action buttons. Renders a div