Alert

Inline status card that can resolve in place: its icon draws a check and the card can fold down to a shorter message. Also includes a modal alert that rises over a dimmed screen.

Preview

Props Changes apply to the live preview above.

Installation

npx @lumioui/cli add alert

Usage

import { ModalAlert, Alert, IOSAlert } from "@/components/ui/alert/alert";
<Alert />

Also exported: ModalAlert, IOSAlert.

Examples

Inline

A trip page where one inline alert blocks check-in.

API reference

Alert

Prop Type Default
variant AlertVariant —
animateLayout boolean

Grow or fold in place on spring.layout when the content changes (e.g. a resolved alert collapsing to one line). Default false.

—
className string —

AlertGlyph

Prop Type Default
variant AlertVariant

Override the status; defaults to the enclosing Alert's variant.

—
size number

Glyph size in pt. Default 22.

—
className string —

ModalAlert

Prop Type Default
open* boolean —
onOpenChange* (open: boolean) => void —
title* string —
message string —
buttons ModalAlertButton[] []
haptic "warning" | "error" | "success" | false

Haptic style when alert appears. Default "warning".

"warning"
glass boolean

Frosted glass panel instead of the solid card. Use only when the screen behind is photographic / moving content. Default false.

false