Primitive / Moleculestable
Alert
Contextual feedback message with default, glass, outline, and ghost variants.
@glinui/uiComponent: alert
Installation
Install from the package for shared ownership or from the registry for copy-paste control.
Package Manager
pnpm add @glinui/ui @glinui/tokensRegistry
pnpm dlx @glinui/cli@latest add alertUsage
Basic
Changes saved
Your workspace has been updated.
TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"23export function Demo() {4 return (5 <Alert>6 <AlertTitle>Changes saved</AlertTitle>7 <AlertDescription>Your workspace has been updated.</AlertDescription>8 </Alert>9 )10}
Glass Variants
Glass
Frosted glass surface with refraction edge.
Liquid
Caustic light pools with depth shimmer.
Matte
Brushed aluminum with inner glow.
Glow
Dark surface with soft outer luminance.
TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"23export function Demo() {4 return (5 <div className="space-y-3">6 <Alert variant="glass">7 <AlertTitle>Glass</AlertTitle>8 <AlertDescription>Frosted glass surface with refraction edge.</AlertDescription>9 </Alert>10 <Alert variant="liquid">11 <AlertTitle>Liquid</AlertTitle>12 <AlertDescription>Caustic light pools with depth shimmer.</AlertDescription>13 </Alert>14 <Alert variant="matte">15 <AlertTitle>Matte</AlertTitle>16 <AlertDescription>Brushed aluminum with inner glow.</AlertDescription>17 </Alert>18 <Alert variant="glow">19 <AlertTitle>Glow</AlertTitle>20 <AlertDescription>Dark surface with soft outer luminance.</AlertDescription>21 </Alert>22 </div>23 )24}
Semantic Variants
Success
Operation completed successfully.
Warning
Please review before continuing.
Error
Something went wrong.
Info
Here is some helpful context.
TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"23export function Demo() {4 return (5 <div className="space-y-3">6 <Alert variant="success">7 <AlertTitle>Success</AlertTitle>8 <AlertDescription>Operation completed successfully.</AlertDescription>9 </Alert>10 <Alert variant="warning">11 <AlertTitle>Warning</AlertTitle>12 <AlertDescription>Please review before continuing.</AlertDescription>13 </Alert>14 <Alert variant="destructive">15 <AlertTitle>Error</AlertTitle>16 <AlertDescription>Something went wrong.</AlertDescription>17 </Alert>18 <Alert variant="info">19 <AlertTitle>Info</AlertTitle>20 <AlertDescription>Here is some helpful context.</AlertDescription>21 </Alert>22 </div>23 )24}
Minimal Variants
Outline
Ghost
TSX
1import { Alert, AlertTitle } from "@glinui/ui"23export function Demo() {4 return (5 <div className="space-y-3">6 <Alert variant="outline"><AlertTitle>Outline</AlertTitle></Alert>7 <Alert variant="ghost"><AlertTitle>Ghost</AlertTitle></Alert>8 </div>9 )10}
Accessibility
- Uses `role="alert"` by default.
- Keep alert text concise and actionable.
- Prefer one alert per context region.
ARIA Attributes
- `role="alert"` native
- `aria-live="assertive"`
Reduced Motion
Alert is static and does not rely on animation.
API Reference
Alert
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | "default" | "glass" | "liquid" | "matte" | "glow" | "outline" | "ghost" | "success" | "warning" | "destructive" | "info" | No | default | Visual treatment. |
size | "sm" | "md" | "lg" | No | md | Padding density. |
role | string | - | alert | ARIA role. |
AlertTitle
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | - | - | Additional class names. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from alertVariants. |
variant | "default" | "glass" | "liquid" | "matte" | "glow" | "outline" | "ghost" | "success" | "warning" | "destructive" | "info" | No | "default" | Variant option from alertVariants. |
AlertDescription
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | - | - | Additional class names. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from alertVariants. |
variant | "default" | "glass" | "liquid" | "matte" | "glow" | "outline" | "ghost" | "success" | "warning" | "destructive" | "info" | No | "default" | Variant option from alertVariants. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { Alert } from "@glinui/ui"Source Files
Dependencies
@glinui/uiGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/alert.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-02-19T17:59:28.468Z · Full index: /docs/api-metadata
Primary Props Type
AlertProps
AlertProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from alertVariants. |
variant | "default" | "glass" | "liquid" | "matte" | "glow" | "outline" | "ghost" | "success" | "warning" | "destructive" | "info" | No | "default" | Variant option from alertVariants. |