Skip to content
Alea0.1

Feedback

Banner

A site-wide announcement bar above the header: launches, sales, maintenance.

Ant Design: Alert banner

import { Banner } from '@alea/ui';

Examples

Props

Banner props

A site-wide announcement bar above the header: launches, sales, outages (Ant Alert banner, Atlassian Banner).

PropTypeDefaultDescription
childrenrequiredReactNode-The message. Keep it to one line on desktop.
actionReactNode-A link or button after the message.
aria-labelstring-Name of the region. Default "Announcement"; give each banner its own when there are several.
classNamestring-
onDismiss(() => void)-Shows a close button; called when closed.
tone"danger" | "warning" | "accent" | "info"'accent'accent (default, gradient), info, warning or danger.

Accessibility

  • A region named "Announcement"; it is not announced on load, so it never interrupts.
  • The dismiss button says what it closes.

Keyboard

KeyDoes
TabReaches the link and the dismiss button

Do and don't

Do

  • One banner at a time.
  • Let people dismiss it and remember that choice.

Don't

  • Don't use it for errors in a form: use Alert.
Tested with axe, keyboard and screen reader roles