Alert
Inline alert with info, success, warning and error variants, optional title, dismiss button and action.
Copy a prompt for your AI coding tool with the source, dependencies and usage
Props
AlertProps
Also accepts all props of Omit<React.ComponentProps<"div">, "title">
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | AlertVariant | "info" | — |
| title | React.ReactNode | — | — |
| description | React.ReactNode | — | — |
| dismissible | boolean | false | Shows a dismiss button. The alert hides itself and calls `onDismiss`. |
| onDismiss | () => void | — | — |
| action | React.ReactNode | — | Optional action, e.g. a button or link, rendered under the text. |
Install
$ npx shadcn@latest add https://chromotion.dev/r/alert.json