Alert

1.0.0

Inline callout for user attention with default and destructive variants, title, description, and an optional action.

Component data

ID
alert
Category
atoms
Version
1.0.0
Added
2026-09-17
Type
component
Keyboard nav
No
Reduced motion
Yes
alertcalloutfeedbackstatusatom

Dependencies

  • clsx
  • tailwind-merge

Examples

Default

<div className="flex w-full max-w-lg flex-col gap-4">
      <Alert>
        <CheckCircle2Icon />
        <AlertTitle>{alertMocks.default.title}</AlertTitle>
        <AlertDescription>{alertMocks.default.description}</AlertDescription>
      </Alert>
      <Alert>
        <InfoIcon />
        <AlertTitle>{alertMocks.feature.title}</AlertTitle>
        <AlertDescription>{alertMocks.feature.description}</AlertDescription>
      </Alert>
    </div>

Variants

<div className="flex w-full max-w-lg flex-col gap-4">
      <Alert>
        <CheckCircle2Icon />
        <AlertTitle>{alertMocks.basic.title}</AlertTitle>
        <AlertDescription>{alertMocks.basic.description}</AlertDescription>
      </Alert>
      <Alert variant="destructive">
        <CircleAlertIcon />
        <AlertTitle>{alertMocks.destructive.title}</AlertTitle>
        <AlertDescription>
          {alertMocks.destructive.description}
        </AlertDescription>
      </Alert>
      <Alert>
        <InfoIcon />
        <AlertTitle>{alertMocks.action.title}</AlertTitle>
        <AlertDescription>{alertMocks.action.description}</AlertDescription>
        <AlertAction>
          <Button size="sm" variant="secondary">
            {alertMocks.action.actionLabel}
          </Button>
        </AlertAction>
      </Alert>
    </div>

Related