Alert
Server ComponentInline callout banner with semantic variants.
Import
tsx
import { Alert, AlertTitle, AlertDescription } from "@cronus-ui/ui";
bash
npx cronus-ui add alert
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component AlertDefault layout:inline style:alert {
description:"Your trial ends soon."
label "Heads up"
}
page "/audit/alert/default" type:custom {
use AlertDefault
}
destructive.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component AlertDestructive layout:inline style:alert+destructive {
description:"Check your card and try again."
label "Payment failed"
}
page "/audit/alert/destructive" type:custom {
use AlertDestructive
}
API Reference
Generated from the component's exported types.
AlertProps
Extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants>
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "info" | "success" | "warning" | "destructive" | "default" | One of "default" | "info" | "success" | "warning" | "destructive". |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
id | string | — | DOM id of the root element. |
AlertTitleProps
Extends HTMLAttributes<HTMLParagraphElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
AlertDescriptionProps
Extends HTMLAttributes<HTMLParagraphElement>
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |