UIComponentsReact
A callout that tells the reader something worth their attention.
Rendered by React 19.3.1
Installation
npx shadcn@4.23.0 add https://hamur.dev/r/react/alert.jsonIt also adds utils. The app needs its setup first: Installation.
Usage
Put AlertTitle and AlertDescription inside; an icon placed first is lined up beside them, and AlertAction sits at the top right. variant="destructive" is for errors. The alert has role="alert", so a screen reader announces it when it appears.
import {
Alert,
AlertTitle,
AlertDescription,
AlertAction,
} from '@/components/ui/alert'Examples
API reference
Alert wraps no headless component of its own: its parts are elements with classes, and their props are the element's.