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
Banners
Accessibility
- With
onClick/hrefthe 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 triggeronClick. backgroundisaria-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.
| Prop | Type | Default | Description |
|---|---|---|---|
| actions | ReactNode | — | Usually a `Button` or `ButtonGroup`. |
| after | ReactNode | — | `dismiss` shows a close button, `chevron` hints at navigation, or pass any node. |
| background | ReactNode | — | Image or gradient behind the content in `image` mode. Decorative. |
| before | ReactNode | — | |
| className | string | — | |
| dismissLabel | string | Dismiss | |
| extraSubtitle | ReactNode | — | |
| href | string | — | |
| imageTheme | "light" | "dark" | dark | Text color over the image: `dark` images get light text. |
| onClick | MouseEventHandler<HTMLElement> | — | Makes the whole banner activatable (the title becomes the button/link). |
| onDismiss | ((event: MouseEvent<HTMLElement, MouseEvent>) => void) | — | |
| rel | string | — | |
| size | "s" | "m" | s | |
| subtitle | ReactNode | — | |
| target | string | — | |
| title | ReactNode | — | |
| variant | "image" | "tint" | tint | `tint` is a soft surface, `image` puts the content over `background`. |