Guided product tours for the web. Docent dims the page, spotlights one element, explains it in a small popover, and gets out of the way.
A tour is a plain JSON document, so tours can be written by hand, reviewed in a pull request, generated, stored in a repo or served from an API. About 15 kB for the engine and the web renderer together.
Documentation · Getting started · Live examples · Tour schema
pnpm add @docentjs/dom # or @docentjs/react, @docentjs/vue, @docentjs/svelteOne package is enough: each framework package includes the engine and the web renderer.
import { createTour, defineTour } from '@docentjs/dom'
const welcome = defineTour({
id: 'welcome',
options: { showProgress: true },
steps: [
{ id: 'intro', title: 'Welcome', body: 'This takes about a minute.' },
{ id: 'sidebar', target: { name: 'sidebar' }, title: 'Navigation', placement: 'right' },
{ id: 'new', target: '#new-project', title: 'Create a project', advance: { on: 'click' } },
{ id: 'done', title: 'All set' },
],
})
createTour(welcome).start()Steps point at elements by name, which survives a redesign better than a CSS class:
<aside data-docent="sidebar">…</aside>For several tours, with rules about who sees which one and when, use the manager:
import { createDocent } from '@docentjs/dom'
const docent = createDocent({ tours: [welcome, billing] })
docent.identify(user.id, { plan: user.plan })- Tours are data. Every visual choice — arrow, spotlight shape and ring, overlay, the step
counter, theme tokens — is a field in the JSON, not CSS in your app. A whole look is one file: a
theme, installable with
npx @docentjs/cli theme add ledger. - Tours, tips and tooltips. A tour can also wait behind a beacon: a small mark on an element that opens a tip on click or hover. One trigger line, the same JSON.
- Small. About 15 kB compressed for engine and renderer. Drawn arrows, beacons and theme presets load only when a tour uses one.
- Accessible. Dialog semantics, focus kept in the popover and returned afterwards, full keyboard control, reduced motion, 44 px touch targets.
- Isolated. The popover renders in a shadow root, so your CSS cannot break it and its CSS cannot leak into your page.
- Any framework, or none. Thin adapters for React, Vue and Svelte over one engine, or bring your own popover with headless mode.
- Checked.
npx @docentjs/cli validate "tours/*.json"in CI, a published JSON Schema, and the same checks in development. - Good with AI. Plain-text docs at llms.txt and a checker, so an assistant can write tours and prove they are valid.
| Package | Description |
|---|---|
@docentjs/dom |
Web renderer: overlay, spotlight, popover, positioning. Start here. |
@docentjs/core |
Platform-agnostic engine: schema, state machine, triggers, persistence, events. No DOM. |
@docentjs/react |
React bindings. |
@docentjs/vue |
Vue bindings. |
@docentjs/svelte |
Svelte bindings. |
@docentjs/devtools |
Development panel: why a tour is not showing, live editing, replay, simulated users, target and contrast checks. |
@docentjs/cli |
docent validate, docent schema, docent theme add. |
Every @docentjs/* package shares one version. While on 0.x: minor may break, patch is safe.
Node 24 (a mise.toml is included) and pnpm 10.
pnpm install
pnpm build # every package
pnpm test # unit tests (Vitest)
pnpm test:e2e # browser tests (Playwright)
pnpm typecheck
pnpm lint # Biome
pnpm size # bundle budgetspnpm --filter @docentjs/docs devruns the documentation site (Astro + Starlight) with live demos.examples/holds vanilla, React, Vue and Svelte apps.
CONTRIBUTING.md has the longer version, RELEASING.md explains how a release happens, SECURITY.md is for reporting a vulnerability, and CODE_OF_CONDUCT.md covers how people treat each other here.