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>
);
}
安装
API 参考
除标注为必填的属性外,其余均为可选。数据、文案和颜色默认使用示例内容。
UserJourneys12 个属性
goalsGoals and their journeys. Defaults to sample Signup, Purchase, Activation.
JourneyGoal[]goalIdControlled selected goal id. Pair with `onGoalChange`.
stringdefaultGoalIdInitial goal id when uncontrolled. Defaults to the first goal.
stringonGoalChangeCalled when a goal tab is chosen.
((id: string) => void)onHighlightChangeCalled when a node is pinned or the pin is cleared.
((highlight: SankeyHighlight | null) => void)pageColorsSVG fill class per page, such as `{ "/pricing": "fill-orange-500" }`.
Record<string, string>paletteFill classes for pages missing from `pageColors`.
string[]convertedColorFill class for the converted outcome.
string默认值
fill-emerald-500formatValueFormats user counts in labels and the tooltip. Defaults to 1.8k style.
((value: number) => string)heightDiagram height in pixels.
number默认值
300labelsText overrides, merged over the English defaults.
Partial<UserJourneysLabels>classNameClasses for the card.
string
UserJourneysFooter3 个属性
summary必填Figures for the selected goal.
JourneySummarylabels必填Block copy.
UserJourneysLabelsseparatorJoins pages in the top path.
string默认值
→
UserJourneysHeader4 个属性
goals必填Goals offered as tabs.
readonly JourneyGoal[]goalId必填Selected goal id.
stringonGoalChange必填Called with the chosen goal id.
(id: string) => voidlabels必填Block copy.
UserJourneysLabels
类型4 个类型
这些属性使用的对象类型及其字段。
JourneyGoal4 个字段
id必填Stable id, used as the tab value.
stringlabel必填Tab label, such as "Signup".
stringconvertedLabel必填Name of the converted outcome node, such as "Signed up".
stringjourneys必填Every path counted for this goal.
Journey[]
UserJourneysLabels13 个字段
title必填Card title.
stringdescription必填Short line under the title.
stringgoalsAriaLabel必填Accessible name for the goal tabs.
stringchartAriaLabel必填Accessible name for the diagram.
stringcolumns必填Column headings, entry first and outcome last. Sets the column count.
string[]droppedLabel必填Name of the drop-off outcome node.
stringusers必填Word after user counts in the tooltip.
stringshareOf必填Joins a share to its base in the tooltip, as in "38% of /pricing".
stringconversion必填Footer label for the conversion rate.
stringtopPath必填Footer label for the most common converting path.
stringbiggestDrop必填Footer label for the step that loses the most users.
stringat必填Joins a drop-off page to its column, as in "/features at Step 2".
stringnone必填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.
JourneyOutcomeusers必填Users who took this exact path.
number
JourneySummary4 个字段
total必填Users who started a journey.
numberconversion必填Converted share, 0 to 100.
numbertopPath必填Pages of the most common converting journey, or null.
string[] | nullbiggestDrop必填The page and column that lose the most users, or null.
{ page: string; column: number; users: number } | null