Alert

Feedback

A component for displaying important messages or feedback. Use alerts to communicate status, warnings, errors, or other important information to users.

Import

import { Alert } from "@/components/ui/alert";

Usage

Variants

Different alert styles for various message types

Default Alert

Neutral alert for general information

Dismissible

Alert that can be closed by the user

Without Title

Simple alert message without title

API Reference

variant"default"
"default" | "success" | "error" | "warning" | "info"

The visual style indicating alert type

title
string

Title text for the alert

children
ReactNode

Alert message content

dismissiblefalse
boolean

Whether the alert can be dismissed

onDismiss
() => void

Handler called when alert is dismissed