Spotlight
A spotlight draws attention to one part of the interface to teach users about a key feature or workflow.
Install
One package and one stylesheet. The stylesheet holds the tokens every component uses.
pnpm add @wolf-rayet/reactimport '@wolf-rayet/react/css/wolf-rayet.css';
import { Spotlight } from '@wolf-rayet/react';Props
A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | None | What this step is about, in a few words. |
| children * | ReactNode | None | One or two sentences. A spotlight interrupts, so it should be brief. |
| actions | ReactNode | None | Forward and back, or a single dismissal at the end. |
| footer | string | None | The position in a sequence, as in 1 of 3, so people know how long this will take. |
Accessibility
What the component does for you, and what it needs from you.
- A spotlight takes focus when it opens and returns it when it closes, so keyboard users stay in the right place.
- It can be dismissed from the keyboard, so keyboard users are never trapped.
- The sequence position is text, so it is announced rather than only seen.