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/tokens

Registry

pnpm dlx @glinui/cli@latest add alert

Usage

Basic

TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"
2
3export 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

TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"
2
3export 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

TSX
1import { Alert, AlertTitle, AlertDescription } from "@glinui/ui"
2
3export 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

TSX
1import { Alert, AlertTitle } from "@glinui/ui"
2
3export 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

PropTypeRequiredDefaultDescription
variant"default" | "glass" | "liquid" | "matte" | "glow" | "outline" | "ghost" | "success" | "warning" | "destructive" | "info"NodefaultVisual treatment.
size"sm" | "md" | "lg"NomdPadding density.
rolestring-alertARIA role.

AlertTitle

PropTypeRequiredDefaultDescription
classNamestring--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

PropTypeRequiredDefaultDescription
classNamestring--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/ui

Generated API Snapshot

Beta

Auto-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

PropTypeRequiredDefaultDescription
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.