Feedbackduskmoonimplemented7 demos

Tour

Tour walks users through key areas of an interface.

Import@duskmoon-dev/components/tour
7API sections
37documented props
5behavior scenarios
Key API
stepsopendefaultOpencurrentdefaultCurrentplacement

Usage

When to use

  • Use it immediately after user actions or system checks that need visible confirmation.
  • Choose the least interruptive feedback surface that still makes the state clear.

Implementation notes

StylesheetImport @duskmoon-dev/components/styles.css once in the app or docs shell.
StateStart with default props for static examples, then switch to controlled props when state must be shared.
ThemeThe preview inherits the active DuskMoon data-theme value from the docs layout.

Features

User feedback

Covers transient, inline, or blocking feedback patterns for user actions and system status.

Action recovery

Shows how the component keeps next actions visible after success, warning, or failure states.

Primary API surface

Tour is most often configured through `steps`, `open`, `defaultOpen`, `current`.

Covered behavior

Renders the current step when open

Feature Demos

Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.

Preview

Basic usage

authored

Import the component stylesheet and Tour from its package subpath, then render it with the core props.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function Example() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview

Renders the current step when open

test-backed

Tour scenario from the component test coverage: renders the current step when open.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function TourRendersTheCurrentStepDemo() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview

Supports uncontrolled step changes and finish close

test-backed

Tour scenario from the component test coverage: supports uncontrolled step changes and finish close.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function TourSupportsUncontrolledStepChangesDemo() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview

Honors controlled current and custom indicators

test-backed

Tour scenario from the component test coverage: honors controlled current and custom indicators.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function TourHonorsControlledCurrentAndDemo() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview

Applies placement, target highlight, and mask config

test-backed

Tour scenario from the component test coverage: applies placement, target highlight, and mask config.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function TourAppliesPlacementTargetHighlightDemo() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview

Supports close callbacks and hidden mask or indicators

test-backed

Tour scenario from the component test coverage: supports close callbacks and hidden mask or indicators.

Source
import "@duskmoon-dev/components/styles.css";
import { Tour } from "@duskmoon-dev/components/tour";

export function TourSupportsCloseCallbacksAndDemo() {
  return (<Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>);
}
Preview
Sunshine Theme
Moonlight Theme

Theme aware

authored

Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.

Source
<div data-theme="sunshine">
  <Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>
</div>

<div data-theme="moonlight">
  <Tour
  open
  mask={false}
  steps={[
    {
      title: "Welcome",
      description: "Review the highlighted workflow.",
      style: {
        position: "static",
        left: "auto",
        top: "auto",
        transform: "none"
      }
    }
  ]}
/>
</div>

API

The API reference below lists every parsed exported type or interface for Tour. Start with `steps`, `open`, `defaultOpen`, `current` for common usage.

Types: packages/components/src/components/tour/Tour.types.tsScenarios: packages/components/src/components/tour/Tour.test.tsx
TourPropsinterface extends Omit< ComponentProps<"div">, "children" | "title" | "onChange" >
PropTypeRequiredDescription
stepsTourStep[]Nosteps configures Tour.
openbooleanNoopen configures Tour.
defaultOpenbooleanNodefaultOpen configures Tour.
currentnumberNocurrent configures Tour.
defaultCurrentnumberNodefaultCurrent configures Tour.
placementTourPlacementNoplacement configures Tour.
maskboolean | TourMaskConfigNomask configures Tour.
indicatorsboolean | ((current: number, total: number) => ReactNode)Noindicators configures Tour.
indicatorsRender(current: number, total: number) => ReactNodeNoindicatorsRender configures Tour.
closeIconReactNodeNocloseIcon configures Tour.
disabledInteractionbooleanNodisabledInteraction configures Tour.
zIndexnumberNozIndex configures Tour.
gapnumberNogap configures Tour.
nextButtonPropsButtonPropsNonextButtonProps configures Tour.
prevButtonPropsButtonPropsNoprevButtonProps configures Tour.
onClose(current: number) => voidNoonClose configures Tour.
onChange(current: number) => voidNoonChange configures Tour.
onFinish() => voidNoonFinish configures Tour.
TourMaskConfiginterface
PropTypeRequiredDescription
classNamestringNoclassName configures Tour.
styleCSSPropertiesNostyle configures Tour.
colorstringNocolor configures Tour.
TourStepinterface
PropTypeRequiredDescription
titleReactNodeNotitle configures Tour.
descriptionReactNodeNodescription configures Tour.
targetTourTargetNotarget configures Tour.
placementTourPlacementNoplacement configures Tour.
coverReactNodeNocover configures Tour.
maskboolean | TourMaskConfigNomask configures Tour.
nextButtonPropsButtonPropsNonextButtonProps configures Tour.
prevButtonPropsButtonPropsNoprevButtonProps configures Tour.
closeIconReactNodeNocloseIcon configures Tour.
classNamestringNoclassName configures Tour.
styleCSSPropertiesNostyle configures Tour.
onClose(current: number) => voidNoonClose configures Tour.
TourTargetRectinterface
PropTypeRequiredDescription
topnumberYestop configures Tour.
leftnumberYesleft configures Tour.
widthnumberYeswidth configures Tour.
heightnumberYesheight configures Tour.
TourPlacementtype
| "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom"
TourTargettype
HTMLElement | null | string | (() => HTMLElement | null)
TourActionEventtype
MouseEvent<HTMLButtonElement>