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 リファレンス

必須と記された props 以外はすべて省略できます。データ、文言、色はサンプルの内容が既定値です。

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

    既定値 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 個の props
  • summary必須

    Figures for the selected goal.

    JourneySummary
  • labels必須

    Block copy.

    UserJourneysLabels
  • separator

    Joins pages in the top path.

    string

    既定値 →

UserJourneysHeader4 個の props
  • 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 個の型

これらの props が受け取るオブジェクト型とそのフィールド。

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