MRR Movement
1 个变体A monthly MRR bridge chart that explains how revenue moved, with the customers behind each movement.
MRR bridge
Starting MRR moves through new, expansion, reactivation, contraction, and churn to ending MRR. Bars reveal in sequence and glide between months, each bar opens a tooltip, and a list shows the customers behind each movement.
MRR movement
Ending MRR
Atlas MutualEnterprise+$3,200
Fernhill SchoolsBusiness+$1,490
Pilot LogisticsBusiness+$1,290
Kindred VetTeam+$790
- Net new MRR
- +$13.2k
- Quick ratio
- 3.4x
- Customers churned
- 13
"use client";
import { MrrMovement } from "@/components/premium/mrr-movement";
export function MrrMovementBridgePreview() {
return (
<div className="w-full px-4 py-10">
<MrrMovement />
</div>
);
}
安装
API 参考
除标注为必填的属性外,其余均为可选。数据、文案和颜色默认使用示例内容。
MrrMovement14 个属性
monthsMonths to pick from, oldest first.
MrrMonth[]monthIdControlled month id.
stringdefaultMonthIdMonth id when uncontrolled. Defaults to the latest month.
stringonMonthChangeCalled with a month id when one is picked.
((id: string) => void)movementControlled movement whose customers are listed.
"new" | "expansion" | "reactivation" | "contraction" | "churn"defaultMovementMovement listed first when uncontrolled.
"new" | "expansion" | "reactivation" | "contraction" | "churn"默认值
newonMovementChangeCalled when a movement is chosen from the chart or tabs.
((kind: MrrMovementKind) => void)maxRowsMost customer rows shown at once.
number默认值
4colorsColors per movement; any movement left out keeps its default.
Partial<Record<MrrMovementKind, MrrMovementColors>>totalColorFill class for the starting and ending bars.
string默认值
bg-foreground/15formatCurrencyFormats full amounts, such as $74,720.
((value: number) => string)formatCompactFormats compact amounts on the chart and footer, such as $12.4k.
((value: number) => string)labelsCopy overrides; anything left out uses the English defaults.
Partial<MrrMovementLabels>classNameClasses merged onto the card.
string
CustomerRow9 个属性
customer必填The customer to draw.
MrrCustomershare必填Bar width as a share of the largest row, 0 to 1.
numberdelay必填Entrance delay in seconds; 0 for rows that arrive after the list opens.
numberreduce必填Skip movement, keep fades.
booleanbarClassName必填Tinted fill behind the row, such as `bg-emerald-500/12`.
stringamountClassName必填Amount text color, such as `text-emerald-700`.
stringcanceledLabel必填Plan shown after the arrow for churned customers.
stringformatCurrency必填Formats the amount, such as $1,490.
(value: number) => stringrefThe row element, so AnimatePresence can pop exiting rows out of the flow.
Ref<HTMLLIElement>
MovementCustomers10 个属性
kinds必填Movements offered as tabs, in order.
MrrMovementKind[]selected必填Selected movement.
"new" | "expansion" | "reactivation" | "contraction" | "churn"onSelect必填Called when a movement tab is chosen.
(kind: MrrMovementKind) => voidmovement必填The selected movement's data, if the month has it.
MrrMovement | undefinedlistKey必填Changes whenever the month or movement changes, to replay the row cascade.
stringmaxRows必填Most rows shown at once.
numbercolors必填Colors for each movement.
Record<MrrMovementKind, MrrMovementColors>formatCurrency必填Formats row amounts, such as $1,490.
(value: number) => stringreduce必填Skip movement, keep fades.
booleanlabels必填Copy for tabs, captions, and the empty state.
MrrMovementLabels
MrrBridge9 个属性
month必填Month to chart.
MrrMonthkinds必填Movements shown, in order.
MrrMovementKind[]selected必填Movement whose customers are listed; its axis label stays highlighted.
"new" | "expansion" | "reactivation" | "contraction" | "churn"onSelect必填Called when a movement bar is clicked or chosen with the keyboard.
(kind: MrrMovementKind) => voidcolors必填Colors for each movement.
Record<MrrMovementKind, MrrMovementColors>totalColor必填Fill class for the starting and ending bars.
stringformatCurrency必填Formats full amounts in the tooltip, such as $61,510.
(value: number) => stringformatCompact必填Formats compact amounts on the axis and labels, such as $12.4k.
(value: number) => stringlabels必填Copy for bar names and tooltip captions.
MrrMovementLabels
MrrFooter5 个属性
net必填Net new MRR for the month, signed.
numberquickRatio必填Gains over losses: (new + expansion + reactivation) / (contraction + churn).
numberchurned必填Customers lost to churn.
numberformatCompact必填Formats net new MRR, such as $9.3k.
(value: number) => stringlabels必填Copy for the three captions.
MrrMovementLabels
MrrHeader7 个属性
months必填Months in the picker, oldest first.
MrrMonth[]monthId必填Id of the month shown.
stringonMonthChange必填Called with a month id when one is picked.
(id: string) => voidstarting必填MRR at the start of the month.
numberending必填MRR at the end of the month.
numberformatCurrency必填Formats the ending MRR, such as $74,720.
(value: number) => stringlabels必填Copy for the title, picker, and captions.
MrrMovementLabels
类型5 个类型
这些属性使用的对象类型及其字段。
MrrMonth4 个字段
id必填Unique key for the month.
stringlabel必填Month name in the picker, such as "Nov 2026".
stringstartingMrr必填MRR on the first day of the month.
numbermovements必填Movements in the month. Kinds left out, or with an amount of 0, are hidden.
Partial<Record<MrrMovementKind, MrrMovement>>
MrrMovementLabels18 个字段
title必填Card title.
stringmonth必填Accessible name for the month picker.
stringendingMrr必填Caption under the ending MRR.
stringvsStart必填Text after the change pill.
stringstarting必填First bar of the chart.
stringending必填Last bar of the chart.
stringchart必填Accessible name for the chart.
stringtabs必填Accessible name for the movement tabs.
stringamount必填Header over the customer amounts.
stringcustomers必填Tooltip caption for the customer count.
stringshare必填Tooltip caption for the share of starting MRR.
stringshowing必填Caption above the customer rows, followed by the shown and total counts.
stringnetNew必填Footer caption for net new MRR.
stringquickRatio必填Footer caption for the quick ratio.
stringchurned必填Footer caption for churned customers.
stringcanceled必填Plan shown for churned customers.
stringempty必填Shown when a movement has no customers.
stringkinds必填Name for each movement kind.
Record<MrrMovementKind, string>
MrrMovementColors3 个字段
bar必填Fill for the bar and the legend dot, such as `bg-emerald-500`.
stringrow必填Tinted fill behind customer rows, such as `bg-emerald-500/12`.
stringtext必填Amount text color for customer rows.
string
MrrMovement3 个字段
amount必填Signed MRR change for the month: positive for gains, negative for losses.
numbercustomers必填Number of customers behind the change.
numbertop必填Largest customers behind the change, shown under the chart.
MrrCustomer[]
MrrCustomer6 个字段
id必填Unique key for the row.
stringcompany必填Company name.
stringavatar必填Portrait URL of the account owner, shown as a round avatar.
stringfromPlanPlan before the change; leave out for new customers.
stringtoPlanPlan after the change; leave out for churned customers.
stringamount必填Signed MRR change from this customer, such as 640 or -399.
number