Skip to content
Drivn logoDrivn

Alert

Contextual feedback messages with variants and icons.

Preview

Heads up

This is a default alert message.

Info

Your trial expires in 3 days.

Success

Your changes have been saved.

Error

Something went wrong. Please try again.

Installation

npx drivn add alert

Usage

1import { Alert } from "@/components/ui/alert"
2
3export default function Page() {
4 return (
5 <Alert title="Heads up!">
6 You can add components to your app using the CLI.
7 </Alert>
8 )
9}

API Reference

PropTypeDefaultDescription
variant"default" | "info" | "success" | "destructive""default"Visual style of the alert
iconComponentType | ReactElementIcon component (Info) or element (<Info className="..." />)
titlestringBold title text displayed above the alert content
classNamestringAdditional CSS classes to apply to the alert container
childrenReactNodeThe content rendered inside the alert body