← All Components
<mth-tour>
Guided multi-step onboarding tour orchestrating Light-DOM <mth-tour-step> children with OverlayController, PositioningController, and FocusTrapController.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-tour>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/tour"></script>
<mth-tour current-step="0">Example</mth-tour>import '@methane-ui/ui/tour';
import '@methane-ui/react';
export function Example() {
return <mth-tour current-step="0">Example</mth-tour>;
}<script setup lang="ts">
import '@methane-ui/ui/tour';
</script>
<template>
<mth-tour current-step="0">Example</mth-tour>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/tour';
import { MthTourDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthTourDirective],
template: `<mth-tour current-step="0">Example</mth-tour>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/tour';
import MthTour from '@methane-ui/svelte/MthTour.svelte';
</script>
<MthTour current-step="0">Example</MthTour>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls whether the guided tour overlay is visible. |
currentStep | current-step | number | 0 | Zero-based index of the active <mth-tour-step>. |
label | label | string | "" | Accessible region/dialog label for the tour. |
forceFallback | force-fallback | boolean | false | Forces JavaScript positioning fallback for deterministic anchoring. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-open | undefined | Cancelable event fired before starting/opening the tour. |
mth-after-open | undefined | Fired after the tour overlay opens. |
mth-close | { reason: string } | Cancelable event fired before closing the tour. |
mth-after-close | undefined | Fired after the tour closes. |
mth-step-change | { index: number; stepId: string } | Fired when the active tour step index changes. |
mth-complete | undefined | Fired when finishing the final tour step. |
mth-skip | { index: number } | Fired when skipping/dismissing before completion. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Escape | both | open | Skips/closes the active tour and restores focus. |
| ArrowRight | both | open | Advances to the next tour step. |
| ArrowLeft | both | open | Returns to the previous tour step. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 3 APG keyboard transitions across LTR/RTL. | mth-tour.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |