bx

Alert

Displays a callout for user attention.

tsx
<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>Something to know.</AlertDescription>
</Alert>

Alert — bloc informatif inline (non-modal, ne bloque pas). Variantes default (info) et destructive (rouge). Pour un dialog bloquant utiliser AlertDialog ; pour un toast éphémère Toast.

Installation

Terminal
$ bext ui add alert

Usage

tsx
import { Alert, AlertTitle, AlertDescription } from "@bext-stack/ui/primitives"

<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>You can add components to your app using the CLI.</AlertDescription>
</Alert>

Anatomy

<Alert>
  ├── <icon />                       // optionnel
  ├── <AlertTitle>Title</AlertTitle>
  └── <AlertDescription>Body</AlertDescription>
</Alert>

API Reference

Alert

Prop Type Default Description
variant "default" | "destructive" "default" undefined
children ReactNode undefined

AlertTitle

Prop Type Default Description
children ReactNode Rendu comme
font-medium.

AlertDescription

Prop Type Default Description
children ReactNode Rendu comme
text-sm text-muted-foreground.

Accessibility

role="alert" par défaut — annoncé immédiatement aux AT. Ne pas abuser (le screen reader interrompt sa lecture). Pour un update passif, préférer role="status" aria-live="polite".

Try it live Open in play

Edit this example live in the bext playground — it compiles and runs entirely in your browser.

src/app/page.tsx 1 file · react · runs in your browser
The React idiom — same UI, for comparison.