Skip to content

Browse components

← All components

Alert

Inline alert with optional indicator, title, and description.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/alert.json

Preview

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.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/alert.json

Usage

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

PropTypeDefault
variant"default" | "primary" | "success" | "warning" | "destructive""default"

AlertIndicator

PropTypeDefault
variant"default" | "primary" | "success" | "warning" | "destructive""default"