User Journeys

1 variant

A path analysis block that traces users from entry page to signup or drop-off in an animated sankey.

Journey sankey

A sankey that traces users from entry page through each step to signup or drop-off. Hover or pin a node to light its full paths, and switch goals to morph every flow to the new data.

User journeys

Entry page to goal, last 30 days

Conversion
50.6%
Top path
/ → /pricing → /signup
Biggest drop-off
/signup at Step 3
"use client";

import { UserJourneys } from "@/components/premium/user-journeys";

export function UserJourneysSankeyPreview() {
  return (
    <div className="w-full px-4 py-10">
      <UserJourneys />
    </div>
  );
}

Install

$ bunx --bun shadcn add @beui-pro/user-journeys-sankey

API Reference

Every prop is optional unless marked required. Data, copy, and colors default to the sample content.

UserJourneys12 props
  • goals

    Goals and their journeys. Defaults to sample Signup, Purchase, Activation.

    JourneyGoal[]
  • goalId

    Controlled selected goal id. Pair with `onGoalChange`.

    string
  • defaultGoalId

    Initial goal id when uncontrolled. Defaults to the first goal.

    string
  • onGoalChange

    Called when a goal tab is chosen.

    ((id: string) => void)
  • onHighlightChange

    Called when a node is pinned or the pin is cleared.

    ((highlight: SankeyHighlight | null) => void)
  • pageColors

    SVG fill class per page, such as `{ "/pricing": "fill-orange-500" }`.

    Record<string, string>
  • palette

    Fill classes for pages missing from `pageColors`.

    string[]
  • convertedColor

    Fill class for the converted outcome.

    string

    Default fill-emerald-500

  • formatValue

    Formats user counts in labels and the tooltip. Defaults to 1.8k style.

    ((value: number) => string)
  • height

    Diagram height in pixels.

    number

    Default 300

  • labels

    Text overrides, merged over the English defaults.

    Partial<UserJourneysLabels>
  • className

    Classes for the card.

    string
UserJourneysFooter3 props
  • summaryRequired

    Figures for the selected goal.

    JourneySummary
  • labelsRequired

    Block copy.

    UserJourneysLabels
  • separator

    Joins pages in the top path.

    string

    Default →

UserJourneysHeader4 props
  • goalsRequired

    Goals offered as tabs.

    readonly JourneyGoal[]
  • goalIdRequired

    Selected goal id.

    string
  • onGoalChangeRequired

    Called with the chosen goal id.

    (id: string) => void
  • labelsRequired

    Block copy.

    UserJourneysLabels
Types4 types

The object types these props take, field by field.

JourneyGoal4 fields
  • idRequired

    Stable id, used as the tab value.

    string
  • labelRequired

    Tab label, such as "Signup".

    string
  • convertedLabelRequired

    Name of the converted outcome node, such as "Signed up".

    string
  • journeysRequired

    Every path counted for this goal.

    Journey[]
UserJourneysLabels13 fields
  • titleRequired

    Card title.

    string
  • descriptionRequired

    Short line under the title.

    string
  • goalsAriaLabelRequired

    Accessible name for the goal tabs.

    string
  • chartAriaLabelRequired

    Accessible name for the diagram.

    string
  • columnsRequired

    Column headings, entry first and outcome last. Sets the column count.

    string[]
  • droppedLabelRequired

    Name of the drop-off outcome node.

    string
  • usersRequired

    Word after user counts in the tooltip.

    string
  • shareOfRequired

    Joins a share to its base in the tooltip, as in "38% of /pricing".

    string
  • conversionRequired

    Footer label for the conversion rate.

    string
  • topPathRequired

    Footer label for the most common converting path.

    string
  • biggestDropRequired

    Footer label for the step that loses the most users.

    string
  • atRequired

    Joins a drop-off page to its column, as in "/features at Step 2".

    string
  • noneRequired

    Shown in the footer when no path converted.

    string
Journey3 fields
  • pagesRequired

    Pages in visit order, entry page first. Up to one per step column.

    string[]
  • outcomeRequired

    Whether these users reached the goal or left.

    JourneyOutcome
  • usersRequired

    Users who took this exact path.

    number
JourneySummary4 fields
  • totalRequired

    Users who started a journey.

    number
  • conversionRequired

    Converted share, 0 to 100.

    number
  • topPathRequired

    Pages of the most common converting journey, or null.

    string[] | null
  • biggestDropRequired

    The page and column that lose the most users, or null.

    { page: string; column: number; users: number } | null