YuhuanStudioYunUIDocs
Feedback

Alert

An inline callout for info / success / warning / error messages, with a leading icon and optional title.

An inline callout for a message the reader needs to act on or acknowledge — a stacked, solid box with a leading icon and an optional bold title.

For a dismissible, full-bleed strip across the top of a page, use Banner instead. Alert is the box that sits in the flow, next to the thing it's about.

Import

tsx
1import { Alert } from "@yuhuanowo/yunui";

Variants

Each tone is token-driven (bg-*-soft / text-* / border-*-soft), so an Alert and a Banner reading the same severity are the same colour, in every theme.

Variants

Heads up

Your trial ends in 3 days.

Saved

Your changes have been saved.
A neutral, brand-toned note.

Title and icon

title is optional — omit it for a single-line note. The icon defaults to one that matches the variant; pass icon={null} to drop it, or your own node to replace it.

Without icon

No glyph, just the message.

Props

Alert also forwards any <div> HTML attributes.

PropTypeDefaultDescription
iconReactNodeLeading icon. Defaults to a variant-appropriate icon; pass `null` to hide.
titleReactNodeOptional bold title above the body.
variant"accent" | "error" | "success" | "warning" | "info"default

On this page