Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Alert
Inline alert with optional indicator, title, and description.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/alert.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/alert.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/alert.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/alert.
Import
import { Alert, AlertDescription, AlertIndicator, AlertTitle} from "@/components/ui/alert"example.tsx
import { Alert, AlertDescription, AlertIndicator, AlertTitle,} from "@/components/ui/alert"export function Example() { return ( <Alert variant="success"> <AlertIndicator variant="success" /> <div> <AlertTitle>Saved</AlertTitle> <AlertDescription>Your changes have been saved.</AlertDescription> </div> </Alert> )}API Reference
Alert
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "primary" | "success" | "warning" | "destructive" | "default" |
AlertIndicator
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "primary" | "success" | "warning" | "destructive" | "default" |