videorc/ui

Alert

A flush inline status row, never a card. The variant is the tone and brings its own icon, and only a destructive alert interrupts a screen reader.

Stream health is poor
Viewers may see buffering. Lower the bitrate or check your upload speed.

Installation

$ pnpm dlx shadcn@latest add @videorc/alert

Usage

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
<Alert variant="warning">
  <AlertTitle>Your microphone is muted.</AlertTitle>
</Alert>

Anatomy

<Alert>
  <AlertTitle />
  <AlertDescription />
  <AlertAction />
</Alert>

Examples

Variants

The variant is the tone. default and quiet are notes (quiet in secondary text), locked says why the controls under it are off, and success, warning and destructive report an outcome. A title alone reads as a message in regular weight; over a description it becomes a heading in medium.

Recordings save to your Movies folder.
Captions appear after the recording stops.
Locked while you’re recording or live.
Changes apply the next time you record or go live.
Recording saved
Launch demo is in your library.
Your microphone is muted.

Icon

Each tone brings one glyph in one weight. Pass icon to show the subject's own mark instead (the microphone, a platform), or icon={null} for none. Never put an icon in the children.

No microphone found
Connect a microphone, or choose one in Sources.
Twitch shows your stream title above the chat.

Theming

Token or attributeMeaning
rounded-rowThe 8 px row radius; no border and no shadow
bg-foreground/4The tint of default, quiet and locked
bg-success/10, bg-warning/10, bg-destructive/10The tone tints; the icon takes the tone colour, the text stays monochrome
data-variantThe tone, for styling a part from the alert with group-data-[variant=…]/alert
data-slot="alert-icon"The leading icon

Accessibility

A destructive alert is role="alert" and is announced at once. Every other tone is role="status", a polite live region. Pass role to override it, for a card that is a group or a note that should stay silent. The icon is aria-hidden: the title carries the meaning.

API reference

Alert

Every <div> prop, plus:

Prop

Type

AlertTitle, AlertDescription and AlertAction take every <div> prop. AlertAction sits in the top-right corner, and the alert pads its text to make room.