Skip to contentWolf-Rayet

Banner

A banner displays a prominent message at the top of the screen.

Install

One package and one stylesheet. The stylesheet carries the tokens every component reads.

pnpm add @wolf-rayet/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { Banner } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
children *ReactNode—The message. One sentence, because a banner is read in passing.
appearance'warning' | 'error' | 'announcement''warning'Warning for something the reader should know, error for something broken, announcement for news.

Accessibility

What the component does for you, and what it needs from you.

  • A banner appearing after load is announced, because a reader who cannot see the top of the page still needs to know.
  • Warning keeps dark text on yellow in both themes, which is the one bold ground that does not invert.
  • Colour separates the three appearances, so the wording has to carry the seriousness on its own.