Skip to content
Alea0.1

Feedback

Tour

A guided walk through a screen, one spotlight at a time.

Ant Design: Tour

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

Examples

Tour

Each step points at part of the page.

Props

Tour props

A guided walk through a screen: each step spotlights an element and explains it (Ant's Tour). Escape skips; focus stays in the step.

PropTypeDefaultDescription
isOpenrequiredboolean-Whether the tour runs (controlled).
onOpenChangerequired(open: boolean) => void-Called when it starts or ends.
stepsrequiredTourStep[]-The steps: target (a CSS selector), title and content.
onFinish(() => void)-Called when the last step is done.

Accessibility

  • Each step is a dialog; focus moves to Next; Skip is always there.

Keyboard

KeyDoes
EnterNext
EscapeSkip the tour

Do and don't

Do

  • Keep it to five steps or fewer.

Don't

  • Don't start it on every visit.
Tested with axe, keyboard and screen reader roles