Yugen UI

MessageBar

MessageBar communicates important information about the state of the whole page or a region.

MessageBar stays until people dismiss it or the situation is resolved, unlike a Toast, which disappears on its own.
SavedYour changes have been synced.

Import

Install from npm, copy the source into your project with @yugen-ui/cli or the shadcn CLI, or import directly when working in this repo.

TSX
// npm install yugen-uiimport { MessageBar } from "yugen-ui";

Variants

Each tile is a standalone example: hover to copy, or press Code to see the source.

TipPress Ctrl+K to search.
SuccessInvitation sent.

Intent

info, success, warning, error.

Actions & dismiss

actions holds buttons that resolve the issue; onDismiss shows a close button.

Multiline

layout="multiline" for long content; actions move to a line below.

Usage

Do
  • Place the MessageBar at the top of the area it describes.
  • State the cause and how to fix it.
Don't
  • Don't show more than 2–3 MessageBars at once.
  • Don't use the error intent for neutral information.

Props

Prop · TypeDefaultDescription
intent"info" | "success" | "warning" | "error"Default: "info"Severity.
titleReactNodeDefault: —Bold title.
actionsReactNodeDefault: —Action buttons (size small).
onDismiss() => voidDefault: —Shows a close button.
layout"singleline" | "multiline"Default: "singleline"Layout.

Messages

Text built into the component: labels, aria-labels, screen reader announcements.

English by default. Change it with the messages prop of YugenProvider, by the namespace below; messagesVi has the Vietnamese set. See Interface language.

messages.messageBar

Key · TypeDefault (English)messagesVi
dismissstring

Nhãn nút đóng (khi có onDismiss).

Default (English)"Dismiss"messagesVi"Đóng thông báo"