Keyboard Navigation

Tourista provides built-in keyboard support for navigating through tours, making them accessible and providing power users with quick navigation options.

Supported Keys

Arrow Right (→)

Advances to the next step in the tour.

  • Action: Sends NEXT event

  • Equivalent to: Clicking the "Next" button

  • Respects: Step's canNext setting

Arrow Left (←)

Goes back to the previous step.

  • Action: Sends PREV event

  • Equivalent to: Clicking the "Previous" button

  • Respects: Step's canPrev setting

Escape (Esc)

Skips/exits the tour entirely.

  • Action: Sends SKIP_TOUR event

  • Equivalent to: Clicking the "Skip" button

  • Triggers: onSkip callback

How It Works

The keyboard navigation is automatically enabled when a tour is active. The implementation listens for keydown events on the document:

Usage

Keyboard navigation works automatically - no configuration needed:

Interaction with Other Features

With Auto-Advance

Keyboard navigation works alongside auto-advance:

Users can:

  • Wait for auto-advance

  • Press to advance immediately

  • Press to go back (cancels auto-advance)

  • Press Esc to skip

With Async Steps

Keyboard navigation respects async step states:

Last updated