Skip to content

Information Banner

⋯

InformationBanner renders the Figma Information Banner set: a title, supporting text, an optional row of additional information, and an optional close button. variant selects Basic, Gradient, or Soft, and color selects one of six accent colors.

import { InformationBanner } from "@nesra/ui/information-banner";
export function SavedNotice({ onDismiss }: { onDismiss: () => void }) {
return (
<InformationBanner color="blue" onDismiss={onDismiss} variant="soft">
<InformationBanner.Title>Account updated successfully</InformationBanner.Title>
<InformationBanner.Description>
Your profile information has been saved.
</InformationBanner.Description>
<InformationBanner.Meta>
<InformationBanner.MetaItem label="Updated by:">Michael Owen</InformationBanner.MetaItem>
</InformationBanner.Meta>
</InformationBanner>
);
}

InformationBanner is also exported from @nesra/ui.

InformationBanner
├── InformationBanner.Title
├── InformationBanner.Description
└── InformationBanner.Meta
└── InformationBanner.MetaItem

Every part is optional. The root adds the accent bar or icon and the close button.

  • basic: a neutral card with a 5px accent bar on the leading edge.
  • gradient: a top-to-bottom gradient from the color’s subtle-hover role to its subtle role, with a 24px icon.
  • soft: the color’s subtle fill with a 4px rounded accent bar.
Account updated (basic)
Your profile information has been saved. Changes will be reflected immediately.
Updated by:
Michael Owen
Role:
Lead
Account updated (gradient)
Your profile information has been saved. Changes will be reflected immediately.
Updated by:
Michael Owen
Role:
Lead
Account updated (soft)
Your profile information has been saved. Changes will be reflected immediately.
Updated by:
Michael Owen
Role:
Lead

color maps the Figma colors to lowercase values. Figma Teal Green is teal.

Soft blue
Changes are saved.
Soft yellow
Changes are saved.
Soft teal
Changes are saved.
Soft orange
Changes are saved.
Soft purple
Changes are saved.
Soft pink
Changes are saved.
Gradient blue
Changes are saved.
Gradient yellow
Changes are saved.
Gradient teal
Changes are saved.
Gradient orange
Changes are saved.
Gradient purple
Changes are saved.
Gradient pink
Changes are saved.

icon replaces the Gradient info icon, and icon={null} hides it. Basic and Soft show the accent bar instead and ignore icon. A Badge inside Title sits after the text with a 12px gap.

New insights are readyDraft
Review the weekly summary before you share it.
Sync complete

onDismiss renders a transparent ghost icon button. The application removes the banner from its own state and moves focus to a control that remains.

Scheduled maintenance
Reports are read-only on Sunday from 01:00 to 03:00.
Part Basic Gradient Soft
Fill Surface/card-bg-neutral Categorical/*/subtle-hover to Categorical/*/subtle Categorical/*/subtle
Border Stroke/stroke-border Categorical/*/border Categorical/*/border
Accent Bar Categorical/*/base Icon Categorical/*/foreground Bar Categorical/*/base
Title Text/text-headline Text/text-headline Text/text-headline
Description, meta term Text/text-secondary Text/text-secondary Text/text-secondary
Meta value Text/text-body Text/text-body Text/text-body
Meta separator Icon/icon-muted Icon/icon-muted Icon/icon-muted
Close button Ghost, Action/tertiary-default, icon Icon/icon-neutral Same Same

The subtle, subtle-hover, border, and foreground roles change between modes. The base roles keep the same value.

  • The root is a <section>. With a Title, it is a region landmark named by the title. Without a Title, it is a plain section.
  • The banner is not a live region. When the application inserts a banner to report the result of an action, pass role="status" so screen readers announce it politely.
  • Meta is a description list. Each MetaItem renders its label as a term and its children as the description.
  • The close button is a native button named by dismissLabel or the translatable “Dismiss” message. Translate it through NesraI18nProvider. The application removes the banner and moves focus after dismissal.
  • The accent bar, icon, and separator dots are hidden from assistive technology. Do not rely on color to convey meaning. State it in the title or description.
Prop Type Default Effect
variant "basic" | "gradient" | "soft" "basic" Selects the Figma variant.
color "blue" | "yellow" | "teal" | "orange" | "purple" | "pink" "blue" Selects the accent color.
icon ReactNode Info icon Gradient only. null hides the icon.
onDismiss (event: MouseEvent<HTMLButtonElement>) => void — Renders the close button and calls the handler when it is pressed.
dismissLabel string Translated “Dismiss” Accessible name of the close button.

Native section attributes, including role, className, and refs, are forwarded. The root has data-variant and data-color.

Semibold 14px title in text-headline. Renders a div and accepts native div props, className, and a ref. Its id names the root region.

Regular 14px supporting text in text-secondary. Renders a div and accepts native div props, className, and a ref.

Regular 12px row of additional information. Renders a dl and accepts native description-list props, className, and a ref.

Prop Type Default Effect
label ReactNode Required Term in text-secondary. Include any colon.
children ReactNode — Value in text-body.

Renders a div around a dt and dd and accepts native div props, className, and a ref. Items after the first are preceded by a 2px separator dot.

Prop types such as InformationBannerProps, InformationBannerVariant, and InformationBannerColor are exported from @nesra/ui and @nesra/ui/information-banner. The banner uses the Light and Dark semantic color roles, typography, layout scale, and shape tokens.