Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Tour

Pass an ordered steps array and a trigger. A step can target an element with a CSS selector or appear in the center.

import { Button, Tour } from '@manti-ui/react';

// A real onboarding tour: every step spotlights an actual part of this
// documentation site's chrome — exactly how you'd guide a first-time user
// through your own app.
const steps = [
  {
    id: 'welcome',
    title: 'Welcome to Manti UI',
    description:
      'Take a quick tour of the docs. Move with Back / Next or the arrow keys.',
    placement: 'center' as const,
  },
  {
    id: 'brand',
    target: '.docs-brand',
    title: 'Always one click home',
    description: 'The logo brings you back to the landing page from anywhere.',
    placement: 'bottom-start' as const,
  },
  {
    id: 'nav',
    target: '.docs-nav-primary',
    title: 'Find your way around',
    description:
      'Getting Started, Foundations, Components and Guides — the four corners of the docs.',
    placement: 'bottom' as const,
  },
  {
    id: 'sidebar',
    target: '.docs-sidebar',
    title: 'The full catalog',
    description:
      'Every component Manti adapts from Zag.js is listed in this sidebar.',
    placement: 'right' as const,
  },
  {
    id: 'actions',
    target: '.docs-nav-actions',
    title: 'Search & theme',
    description: 'Jump anywhere with search, or switch between light and dark.',
    placement: 'bottom-end' as const,
  },
  {
    id: 'toc',
    target: '.docs-toc',
    title: 'On this page',
    description: 'Every section of the page you are reading, one click away.',
    placement: 'left' as const,
  },
];

export default function TourBasic() {
  return (
    <Tour
      steps={steps}
      trigger={<Button variant="primary">Take a tour of the docs</Button>}
    />
  );
}

API

PropTypeDefaultDescription
stepsTourStep[]The ordered steps — each `{ id, title, description, target?, placement? }`.
triggerReactElementElement that starts the tour. Cloned with an onClick handler.

Styling

Anatomy

PartSelectorDescription
backdrop[data-scope="tour"][data-part="backdrop"]The dimming layer behind the spotlight.
spotlight[data-scope="tour"][data-part="spotlight"]The cutout that highlights the targeted element.
positioner[data-scope="tour"][data-part="positioner"]The floating wrapper that positions the content.
content[data-scope="tour"][data-part="content"]The step card.
progress-text[data-scope="tour"][data-part="progress-text"]The "step N of M" indicator.
title[data-scope="tour"][data-part="title"]The step title.
description[data-scope="tour"][data-part="description"]The step description.
arrow[data-scope="tour"][data-part="arrow"]The pointer connecting the card to its target.
close-trigger[data-scope="tour"][data-part="close-trigger"]The button that ends the tour.
actions[data-scope="tour"][data-part="actions"]The Back / Next row; the last step finishes with "Done".

Tokens

TokenControls
--manti-tour-widthwidth
--manti-tour-overlay-extentoverlay extent

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub