Skip to contentWolf-Rayet

Section message

A section message alerts users to one section of the screen.

Install

One package and one stylesheet. The stylesheet holds the tokens every component uses.

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

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
titlestringNoneA short heading. Leave it out when the message is one line and the heading would only repeat it.
children *ReactNodeNoneThe message. Two or three sentences at most.
appearance'information' | 'warning' | 'success' | 'error' | 'discovery''information'Sets the type of message. Information is the default and usually the right choice.
actionsReactNodeNoneOne or two actions belonging to the message. Anything more belongs on the page.

Accessibility

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

  • The message sits next to what it describes, so people reach it in reading order.
  • The five appearances differ by colour and icon, so the words must still carry the meaning.
  • Actions are real buttons and links, reachable in order after the message that explains them.