Skip to main content

Alert

Alerts display a short, important message in a way that attracts the user's attention.

On this page
Props
variant
icon
<Alert>
  <AlertTitle>Alert Title</AlertTitle>
  <AlertDescription>This is an alert description.</AlertDescription>
</Alert>

Installation

npx shadcn@latest add @dotui/alert

Usage

Use alerts to display important messages that require user attention.

import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
<Alert>
  <AlertTitle>Alert Title</AlertTitle>
  <AlertDescription>Alert description</AlertDescription>
</Alert>

Examples

Default

Warning

Danger

Success

Custom Icon

Action

API Reference

Alert

An alert displays a short, important message that attracts the user's attention without interrupting their task.

Supports all div attributes.

PropType
union

AlertTitle

The title of the alert.

Supports all div attributes.

PropType

AlertDescription

The description of the alert.

Supports all div attributes.

PropType

AlertAction

Contains actions such as buttons, displayed at the end of the alert.

Supports all div attributes.

PropType

Last updated on 6/16/2026