User Journeys

1 个变体

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>
  );
}

安装

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

API 参考

除标注为必填的属性外,其余均为可选。数据、文案和颜色默认使用示例内容。

UserJourneys12 个属性
  • 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

    默认值 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

    默认值 300

  • labels

    Text overrides, merged over the English defaults.

    Partial<UserJourneysLabels>
  • className

    Classes for the card.

    string
UserJourneysFooter3 个属性
  • summary必填

    Figures for the selected goal.

    JourneySummary
  • labels必填

    Block copy.

    UserJourneysLabels
  • separator

    Joins pages in the top path.

    string

    默认值 →

UserJourneysHeader4 个属性
  • goals必填

    Goals offered as tabs.

    readonly JourneyGoal[]
  • goalId必填

    Selected goal id.

    string
  • onGoalChange必填

    Called with the chosen goal id.

    (id: string) => void
  • labels必填

    Block copy.

    UserJourneysLabels
类型4 个类型

这些属性使用的对象类型及其字段。

JourneyGoal4 个字段
  • id必填

    Stable id, used as the tab value.

    string
  • label必填

    Tab label, such as "Signup".

    string
  • convertedLabel必填

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

    string
  • journeys必填

    Every path counted for this goal.

    Journey[]
UserJourneysLabels13 个字段
  • title必填

    Card title.

    string
  • description必填

    Short line under the title.

    string
  • goalsAriaLabel必填

    Accessible name for the goal tabs.

    string
  • chartAriaLabel必填

    Accessible name for the diagram.

    string
  • columns必填

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

    string[]
  • droppedLabel必填

    Name of the drop-off outcome node.

    string
  • users必填

    Word after user counts in the tooltip.

    string
  • shareOf必填

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

    string
  • conversion必填

    Footer label for the conversion rate.

    string
  • topPath必填

    Footer label for the most common converting path.

    string
  • biggestDrop必填

    Footer label for the step that loses the most users.

    string
  • at必填

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

    string
  • none必填

    Shown in the footer when no path converted.

    string
Journey3 个字段
  • pages必填

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

    string[]
  • outcome必填

    Whether these users reached the goal or left.

    JourneyOutcome
  • users必填

    Users who took this exact path.

    number
JourneySummary4 个字段
  • total必填

    Users who started a journey.

    number
  • conversion必填

    Converted share, 0 to 100.

    number
  • topPath必填

    Pages of the most common converting journey, or null.

    string[] | null
  • biggestDrop必填

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

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