Alert

Inline callouts for updates, warnings, and errors.

Share status and feedback without interrupting the page. Start with a title and description, then add an icon or action when useful.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert>      <AlertTitle>Registry sync finished</AlertTitle>      <AlertDescription>        New items are listed locally. Refresh the docs if a page still looks        stale.      </AlertDescription>    </Alert>  )}

Installation

npx @arctis-sh/@arctis-sh/ui@latest add alert

Usage

import {  Alert,  AlertAction,  AlertDescription,  AlertTitle,} from "@/components/ui/alert"
<Alert>  <AlertTitle>Registry sync finished</AlertTitle>  <AlertDescription>    New items are available locally. Refresh the docs if a page still looks out of date.  </AlertDescription></Alert>

Composition

Alert
├── Icon
├── AlertTitle
├── AlertDescription
└── AlertAction

The title and description carry the message. Add an SVG as a direct child for a leading icon, and use AlertAction for an optional control in the top-right.

Basic

A simple title and description, without an icon.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert>      <AlertTitle>Registry sync finished</AlertTitle>      <AlertDescription>        New items are listed locally. Refresh the docs if a page still looks        stale.      </AlertDescription>    </Alert>  )}

With icon

Pass an SVG as a direct child of Alert to show a leading icon.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert>      <CheckIcon />      <AlertTitle>Component installed</AlertTitle>      <AlertDescription>        Source landed in your repo. Open the file and tweak it like any other        local module.      </AlertDescription>    </Alert>  )}

Success

Use variant="success" to confirm a completed action.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert variant="success">      <CheckIcon />      <AlertTitle>Theme tokens applied</AlertTitle>      <AlertDescription>        Light and dark variables are wired. Preview the docs site to confirm        contrast.      </AlertDescription>    </Alert>  )}

Warning

Use variant="warning" for cautionary or time-sensitive information.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert variant="warning">      <WarningIcon />      <AlertTitle>CLI cache is outdated</AlertTitle>      <AlertDescription>        Run a fresh install before adding components so you do not pull a        stale registry snapshot.      </AlertDescription>    </Alert>  )}

Destructive

Use variant="destructive" for failures and errors that need attention.

tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"export function Example() {  return (    <Alert variant="destructive">      <AlertCircleIcon />      <AlertTitle>Could not resolve registry</AlertTitle>      <AlertDescription>        The namespace URL did not return an index. Check the registries map in        your config and try again.      </AlertDescription>    </Alert>  )}

Action

Wrap a button or other control in AlertAction. Add right padding to Alert so the message has room beside it.

tsx
import {  Alert,  AlertAction,  AlertDescription,  AlertTitle,} from "@/components/ui/alert"import { Button } from "@/components/ui/button"export function Example() {  return (    <Alert className="pr-28">      <InfoIcon />      <AlertTitle>New accordion patterns</AlertTitle>      <AlertDescription>        Nested and card-grid examples shipped. Pull the latest docs when you        have a minute.      </AlertDescription>      <AlertAction>        <Button type="button" size="sm">          View        </Button>      </AlertAction>    </Alert>  )}

API Reference

Alert

PropTypeDefault
variant"default" | "success" | "warning" | "destructive""default"
classNamestring
role"alert""alert"
<Alert>  <AlertTitle>Sync complete</AlertTitle>  <AlertDescription>Your local registry is up to date.</AlertDescription></Alert>

AlertTitle

PropTypeDefault
classNamestring
<AlertTitle>Sync complete</AlertTitle>

AlertDescription

PropTypeDefault
classNamestring
<AlertDescription>Your local registry is up to date.</AlertDescription>

AlertAction

PropTypeDefault
classNamestring
<AlertAction>  <Button size="sm" variant="outline">Undo</Button></AlertAction>