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

PropTypeDefaultDescription
variant"default" | "success" | "error" | "warning" | "info""default"The visual style indicating alert type
titlestringTitle text for the alert
childrenReactNodeAlert message content
dismissiblebooleanfalseWhether the alert can be dismissed
onDismiss() => voidHandler called when alert is dismissed

Related Components