
Inline status banners with default, destructive, success, warning, and info variants.
npx shadcn@latest add https://ui.edbn.me/api/analytics/registry/alert.jsonLocal inline status wrapper. Renders a div with role="alert" by default and accepts native div props.
variant'default' | 'destructive' | 'success' | 'warning' | 'info''default'Local visual tone provided by this wrapper.
classNamestringAdditional classes merged after the variant classes with cn().
roleReact.AriaRole'alert'ARIA live-region role. Use 'status' for non-urgent updates.
childrenReact.ReactNodeAlert content. Usually combines an optional icon, AlertTitle, and AlertDescription.
refReact.Ref<HTMLDivElement>React 19 ref forwarded to the root div.
...propsReact.ComponentPropsWithRef<'div'>All native div attributes, including id, style, aria-* and data-* attributes.
| Attribute | Description |
|---|---|
| data-slot="alert" | Stable slot marker on the root element for styling and testing. |
| Variable | Description |
|---|---|
| --alert-tone | Theme-aware tone color used to derive variant styling. |
| --alert-accent | Accent color used by the optional icon treatment. |
| --alert-border | Resolved border color for the active variant. |
| --alert-surface | Resolved background surface color for the active variant. |
| --alert-foreground | Resolved title and root text color. |
| --alert-muted | Resolved description text color. |
| --alert-mark-surface | Solid surface behind a direct child icon. |
| --alert-code-surface | Solid inline code background color. |
| --alert-code-border | Inline code border color. |
Alert heading. Renders an h5 element and accepts native heading props.
childrenReact.ReactNodeHeading content.
classNamestringAdditional classes merged with the default title styles.
refReact.Ref<HTMLHeadingElement>React 19 ref forwarded to the h5 element.
...propsReact.ComponentPropsWithRef<'h5'>All native h5 attributes.
| Attribute | Description |
|---|---|
| data-slot="alert-title" | Stable slot marker on the title element for styling and testing. |
Alert body text. Renders a div element and accepts native div props.
childrenReact.ReactNodeDescription content, including paragraphs or inline text.
classNamestringAdditional classes merged with the default description styles.
refReact.Ref<HTMLDivElement>React 19 ref forwarded to the description div.
...propsReact.ComponentPropsWithRef<'div'>All native div attributes.
| Attribute | Description |
|---|---|
| data-slot="alert-description" | Stable slot marker on the description element for styling and testing. |