Skip to content
Feedback

Alert

Server Component

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

PortedParity: MatchGeometry 2/2Pixel diff 0 pxLogic 1/1Parity scoreboard
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>

Skip AlertProps props table
PropTypeDefaultDescription
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>

Skip AlertTitleProps props table
PropTypeDefaultDescription
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>

Skip AlertDescriptionProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.