Alert

Contextual feedback banners with five severity variants. Pure CSS — no Radix dependency.

  • 5 variants: default, destructive, warning, success, info
  • Icon slot via svg sibling selectors — just drop an SVG inside
  • AlertTitle for bold heading, AlertDescription for body text
  • role="alert" for screen reader announcement

import { Alert }from "@aetherstack/ui"

alert.tsx
import { Alert, AlertTitle, AlertDescription } from "@aetherstack/ui"
import { CheckCircle2 } from "lucide-react"

<Alert variant="success">
  <CheckCircle2 className="h-4 w-4" />
  <AlertTitle>Success</AlertTitle>
  <AlertDescription>Your changes have been saved.</AlertDescription>
</Alert>

Usage

Without icon

The icon slot is optional — the layout adapts automatically.

Description only

AlertTitle is optional — use just AlertDescription for brief messages.

Props

PropTypeDefaultDescription
variant"default" | "destructive" | "warning" | "success" | "info""default"Controls border and text colour of the alert.
classNamestringAdditional classes on the alert div.
...propsReact.HTMLAttributes<HTMLDivElement>All standard HTML div attributes.

* Required props

Accessibility

  • Alert has role="alert" so screen readers announce it immediately when it appears in the DOM.
  • For non-urgent updates consider role="status" instead — override via the role prop.
  • If the alert contains a link or button, ensure those are keyboard-accessible.