Alert

A composable alert component for displaying important messages with multiple variants, appearances, and sizes.

View Markdown

Variants

Appearances

Sizes

With Icon

With Close

With Action

API Reference

Alert

Root container for alert messages. Renders with role="alert" by default.

PropTypeDefaultDescription
variant'default' | 'destructive' | 'success' | 'warning' | 'info''default'Color variant of the alert
appearance'default' | 'outline' | 'filled''default'Visual appearance style
size'sm' | 'md' | 'lg''md'Size of the alert
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"div">-Standard div element props

AlertContent

Wrapper for title and description with vertical spacing.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"div">-Standard div element props

AlertIcon

Icon slot that inherits color from the alert variant.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"span">-Standard span element props

AlertTitle

Bold title text rendered as an h5 element.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"h5">-Standard h5 element props

AlertDescription

Body text for the alert message.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"div">-Standard div element props

AlertAction

Action slot positioned at the end of the alert for buttons or links.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"div">-Standard div element props

AlertClose

Dismiss button for closing the alert. Handle state externally via onClick.

PropTypeDefaultDescription
onClick() => void-Callback when the close button is clicked
classNamestring-Additional CSS classes
...propsReact.ComponentProps<"button">-Standard button element props