Atomx Docs
Components

Alert

Displays a short, important message to attract the user's attention without interrupting their task.

Install

npx shadcn@latest add https://atomx.acau.net/r/alert.json

Usage

Alert is a static, inline callout — unlike Alert Dialog, it does not interrupt the user or require a response. Compose it from an optional icon, an AlertTitle, and an AlertDescription. An <svg> icon placed directly inside Alert is laid out into the leading column automatically.

Use the destructive variant for errors and failures; keep the default variant for neutral, informational messages.

<Alert variant="destructive">
  <CircleAlert />
  <AlertTitle>Unable to save changes</AlertTitle>
  <AlertDescription>Check your connection and try again.</AlertDescription>
</Alert>

Preview

Default

Destructive

Props

Alert extends React.ComponentProps<"div">.

PropTypeNotes
variant"default" | "destructive"Visual style. Defaults to default.
classNamestringMerged with the variant classes.

AlertTitle and AlertDescription extend React.ComponentProps<"div"> and are positioned by Alert's internal grid.