datui
Color scheme

Data display

Banner

Promo or announcement block with actions and dismiss/chevron.

import { Banner } from "datui";

Playground

AnnouncementSomething new
<Banner title="Announcement" subtitle="Something new" variant="tint" size="s" />

Examples

Accessibility

  • With onClick/href the title becomes the button/link, stretched over the banner; actions and dismiss stay separate controls.
  • The dismiss button is labelled by dismissLabel ("Dismiss") and does not trigger onClick.
  • background is aria-hidden.

API

Banner

Promo/announcement block. When clickable, the title is the real button/link stretched over the banner, so the dismiss button and actions stay separate controls.

PropTypeDefaultDescription
actionsReactNode—Usually a `Button` or `ButtonGroup`.
afterReactNode—`dismiss` shows a close button, `chevron` hints at navigation, or pass any node.
backgroundReactNode—Image or gradient behind the content in `image` mode. Decorative.
beforeReactNode—
classNamestring—
dismissLabelstringDismiss
extraSubtitleReactNode—
hrefstring—
imageTheme"light" | "dark"darkText color over the image: `dark` images get light text.
onClickMouseEventHandler<HTMLElement>—Makes the whole banner activatable (the title becomes the button/link).
onDismiss((event: MouseEvent<HTMLElement, MouseEvent>) => void)—
relstring—
size"s" | "m"s
subtitleReactNode—
targetstring—
titleReactNode—
variant"image" | "tint"tint`tint` is a soft surface, `image` puts the content over `background`.