Dashral Pro is hereSee pricing

Dashral

Product TourNew

A guided tour that dims the page around one element at a time and explains it in a card beside it.

$ pnpm dlx shadcn@latest add @dashral/product-tour

Installation

$ pnpm dlx shadcn@latest add @dashral/product-tour

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Or by its full URL: https://dashral.com/r/product-tour.json

When to use

  • Showing new users around an app on their first visit, a step per part of the screen.
  • Pointing out a new feature where it lives, in a step or two.

When not to use

  • A one-line hint on one control: Tooltip or Popover.
  • Setup the user must finish, with fields to fill: Steps in a page or a Dialog.
  • An announcement that isn't about a place on the screen: Banner or Toast.

Usage

Each step points at an element by a CSS selector; a trigger starts it.

example.tsx
import { Button } from "@/components/dashral/button"
import { Input } from "@/components/dashral/input"
import { ProductTour } from "@/components/dashral/product-tour"

export default function Toolbar() {
  return (
    <div className="flex items-center gap-2">
      <Input id="search" type="text" role="searchbox" aria-label="Search" placeholder="Search…" />
      <Button id="new-project">New project</Button>
      <ProductTour
        trigger={<Button variant="outline">Take the tour</Button>}
        steps={[
          { target: "#search", title: "Find anything", description: "Projects, people and files." },
          { target: "#new-project", title: "Start a project", description: "From a template or blank." },
        ]}
      />
    </div>
  )
}

Using the npm package? Import from @dashral/ui/components/product-tour instead, here and in the examples; the rest is the same.

Examples

First-run onboarding

Opened with open and onOpenChange. Steps without a target sit in the middle of the screen (a welcome with a picture, and a last word); onFinish runs only when Done is pressed.

Revenue

$48,250

Up +12.4%vs last month

Orders

1,284

Down −3.1%vs last month

API reference

ProductTour

PropTypeDefault
stepsTourStep[]

The steps, in order. Required.

—
triggerReactElement

What starts the tour from its first step, e.g. a button. Or open it yourself with open.

—
open / onOpenChange

Control whether it shows.

—
defaultOpenboolean

Show it on mount, e.g. on a user's first visit.

false
step / onStepChangenumber

The step showing, from 0.

—
defaultStepnumber

The step it opens on.

0
onFinish() => void

Called when Done is pressed on the last step. Closing early with × or Escape doesn't call it.

—
paddingnumber

Room in pixels between the target and the edge of its spotlight.

6
classNames{ card, spotlight }

Classes for each part.

—
classNamestring

The card's classes, e.g. a width.

—

TourStep

PropTypeDefault
targetstring | RefObject | () => HTMLElement | null

What the step points at: a CSS selector, a ref or a function. Without one, or when nothing on the page matches, the card sits in the middle of the screen.

—
titleReactNode

Required.

—
descriptionReactNode

The words under the title.

—
mediaReactNode

A picture or anything else above the title.

—
side"top" | "right" | "bottom" | "left"

Where the card sits; it moves to another side when there isn't room.

"bottom"
align"start" | "center" | "end"

How the card lines up with the target along that side.

"center"

Keyboard

KeysAction
→or←The next or previous step (in reading order: reversed in Arabic)
TabMoves between the card's buttons; focus stays in the card
EscapeClose the tour, back to where focus was

Accessibility

  • The card is a modal dialog named by the step's title and described by its words. It takes focus as it opens and gives it back when it closes.
  • Each new step is announced ("Step 2 of 4"). The dots beside the buttons are hidden from screen readers.
  • The page under the tour can't be clicked while it shows; a target out of view is scrolled into the middle of the screen.
  • Its words come from the kit's messages, so a LocaleProvider translates them.

Motion

  • The dimming and the card fade in. Between steps the spotlight and the card glide to their new places together (--duration-considered, --ease-standard), the card's height glides to the new words, and the old words fade out as the new ones fade in. A step without a target closes the spotlight to a point in the middle. With reduced motion everything moves at once.

Blocks and screens

Sections and whole screens ready to drop in: the ones built with Product Tour or for the same job first, then more from Dashral Pro. Free ones come with their code; Pro ones come with Dashral Pro.

  • Feature tourPro

    Features that play: the open one fills a line, then the next; beside it a product screen shows it working — sources connecting, a dashboard arranging itself, alerts arriving, a team joining.

  • Data pipelinePro

    Records flowing live from three sources through one transform to every destination: raw dots go in, come out as solid squares and go to one, some or all outputs at their own pace, cards lighting up with live counts, the ring quickens as it works, and the count climbs; slows under the pointer, pauses, and stacks on phones.

  • Agent pipelinePro

    An AI agent at work, live: a question is typed and sent, the agent calls its tools one at a time (each spins, then shows what it found), and the answer streams in token by token; slows under the pointer, pauses, and stacks on phones.