Alert
Displays a callout for user attention.
Changes saved
Your profile has been updated and is visible to your team.
Installation
npx shadcn@latest add @uqudo/alertUsage
import { Alert, AlertDescription, AlertTitle } from "@/components/uqudo/ui/alert"<Alert>
<CheckCircle2 />
<AlertTitle>Changes saved</AlertTitle>
<AlertDescription>Your profile has been updated.</AlertDescription>
</Alert>Drop an icon in as the first child and the alert switches to a two-column grid, sizing the icon and aligning the title and description beside it.
Examples
Destructive
Colours the text and icon with the destructive token for errors and failures.
Payment failed
Your card was declined. Update your billing details and try again.
With action
AlertAction pins its children to the top end corner and reserves room for
them, so a button or link never overlaps the text.
Update available
A new version of the SDK is ready to install.
API Reference
Alert
A div with role="alert".
Prop
Type
AlertTitle
Prop
Type
AlertDescription
Prop
Type
AlertAction
An absolutely positioned slot for a control such as a button or a dismiss icon. When present, the alert adds end padding so the content clears it.
Prop
Type
Data attributes
| Component | data-slot |
|---|---|
Alert | alert |
AlertTitle | alert-title |
AlertDescription | alert-description |
AlertAction | alert-action |