YuhuanStudioYunUIDocs
Patterns

Banner

A tinted horizontal banner row (info / warning / critical / success) with an icon, title, inline description, meta, actions and an optional dismiss — for announcements, releases and verification prompts.

A tinted, horizontal banner row for dashboard headers and home screens: a tone-colored gradient card with an icon, a title + optional inline description, optional meta (e.g. a timestamp), a trailing actions slot, and an optional dismiss button. It covers announcement / release / verification-style banners with one component.

Presentation only — the host owns fetching, dismiss persistence, and copy. (For a stacked, solid form-message box, use the Alert primitive instead.)

Import

import { Banner } from "@yuhuanowo/yunui/patterns";

Example

tone drives the gradient, border, text and icon color (and a default icon). dismissible adds the ✕ button; actions and meta are slots.

Banner

Scheduled maintenance
2h ago
v1.4.0 shipped
1d ago
Verify your email
Payment failed

Tones

info · warning · critical · success · neutral. Each sets the gradient + a default icon; override the glyph with icon (e.g. a Rocket for a release), or pass icon={null} to omit it.

Props

PropTypeDefaultDescription
actionsReactNodeTrailing actions — links or buttons.
classNamestring
descriptionReactNodeSecondary text shown inline after the title (hidden on mobile).
dismissiblebooleanShow a dismiss (✕) button.
dismissLabelstring
iconReactNodeLeading icon; defaults to a tone-appropriate glyph (pass `null` to omit).
metaReactNodeSmall right-aligned meta (e.g. a relative timestamp).
onDismiss(() => void)
title*ReactNodeThe banner headline.
tone"info" | "warning" | "critical" | "success" | "neutral"infoTone — drives the gradient, border, text and icon color.

On this page