"use client";
import { Tour } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
steps (required) | readonly TourStep[] | — | — |
onOpenChange | (open: boolean) => void | — | Called with the next open state. |
open | boolean | — | Open state (controlled). |
closeLabel | ReactNode | from the message catalog | Accessible name of the close button (default from the message catalog). |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
defaultValue | string | — | Initial value when uncontrolled. |
nextLabel | ReactNode | — | — |
onFinish | () => void | — | — |
onValueChange | (value: string) => void | — | Called with the new value (only when it changes). |
previousLabel | ReactNode | — | — |
value | string | — | Current value (controlled); null where it means "nothing selected". |
stepsrequiredreadonly TourStep[]
onOpenChange(open: boolean) => void
Called with the next open state.
openboolean
Open state (controlled).
closeLabeldefault from the message catalogReactNode
Accessible name of the close button (default from the message catalog).
defaultOpenboolean
Initial open state when uncontrolled.
defaultValuestring
Initial value when uncontrolled.
nextLabelReactNode
onFinish() => void
onValueChange(value: string) => void
Called with the new value (only when it changes).
previousLabelReactNode
valuestring
Current value (controlled); null where it means "nothing selected".
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const steps = [
{ id: "save", title: "Save", content: "Your work saves on its own." },
];
const [open, setOpen] = useState(false);
<Button onClick={() => setOpen(true)}>Start tour</Button>
<Tour open={open} onOpenChange={setOpen} steps={steps} />