Alert

Inline callout for statuses and problems — four tones, dismiss button, icon overrides.

Alert is a static, inline callout: it communicates without interrupting (unlike Toast or Dialog). Four tones map to the semantic tokens, and warning/destructive tones announce as role="alert".

Installation

import { Alert } from "@iammikz/srui";

Usage

Heads up

Scheduled maintenance Sunday 02:00–03:00 UTC.

Deployed

Build 128 is live on all regions.

Props

PropTypeDefaultDescription
variant"info" | "success" | "warning" | "destructive""info"Tone + icon + role
titleReactNode—Bold first line
childrenReactNode—Body copy
iconLucideIcon | nullvariant defaultOverride or disable the icon
onDismiss() => void—Renders a dismiss button

The body can also be composed from subcomponents — equivalent to the title prop + children shorthand:

ExportNotes
AlertTitleBold first line
AlertDescriptionBody copy

Accessibility

info/success render role="status" (polite); warning/destructive render role="alert" (assertive). The dismiss button is labelled, and the icon is decorative (aria-hidden).

Upgrades over the PRUI original: a dismiss affordance and icon override.