Components
Tour
Tour, dressed in the paper-and-ink system: a dimmed page where the spotlight alone keeps the focus halo, and the anchored card rides the shared popup vessel. The parts — Root, Backdrop, Spotlight, Positioner, Content, Arrow, ArrowTip, Title, Description, ProgressText, Control, Actions, ActionTrigger, CloseTrigger, plus useTour.
#Basic usage
<script setup lang="ts">
import { Button, Tour, useTour } from "@bysages/vue";
const tour = useTour({
steps: [
{
id: "welcome",
type: "dialog",
title: "Welcome",
description: "A short walk through the room before the ink settles.",
actions: [{ label: "Start", action: "next" }],
},
{
id: "anchor",
type: "tooltip",
title: "The worktable",
description: "Everything stays on the paper; nothing leaves the page.",
target: () => document.getElementById("tour-anchor"),
actions: [{ label: "Finish", action: "dismiss" }],
},
],
});
</script>
<template>
<Tour.Root :tour="tour">
<Button @click="tour.start()">Start tour</Button>
<div id="tour-anchor" class="p-4 border border-dashed border-border">Anchor element</div>
<Teleport to="body">
<Tour.Backdrop />
<Tour.Spotlight />
<Tour.Positioner>
<Tour.Content>
<Tour.ProgressText />
<Tour.Title />
<Tour.Description />
<Tour.Control>
<Tour.Actions v-slot="actions">
<Tour.ActionTrigger v-for="action in actions" :key="action.label" :action="action">
{{ action.label }}
</Tour.ActionTrigger>
</Tour.Actions>
</Tour.Control>
</Tour.Content>
</Tour.Positioner>
</Teleport>
</Tour.Root>
</template>
#Props
#ActionTrigger
| Prop | Type | Default | Description |
|---|---|---|---|
action | StepAction | — |
#Actions
A styled part — no props of its own; it takes the anatomy's shared styling.
#ArrowTip
A styled part — no props of its own; it takes the anatomy's shared styling.
#Arrow
A styled part — no props of its own; it takes the anatomy's shared styling.
#Backdrop
A styled part — no props of its own; it takes the anatomy's shared styling.
#CloseTrigger
A styled part — no props of its own; it takes the anatomy's shared styling.
#Content
A styled part — no props of its own; it takes the anatomy's shared styling.
#Control
A styled part — no props of its own; it takes the anatomy's shared styling.
#Description
A styled part — no props of its own; it takes the anatomy's shared styling.
#Positioner
A styled part — no props of its own; it takes the anatomy's shared styling.
#ProgressText
A styled part — no props of its own; it takes the anatomy's shared styling.
#Root
| Prop | Type | Default | Description |
|---|---|---|---|
tour | UnwrapRef<UseTourReturn> | — |
#Spotlight
A styled part — no props of its own; it takes the anatomy's shared styling.
#Title
A styled part — no props of its own; it takes the anatomy's shared styling.