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

$74,72021.5%vs starting MRR

Ending MRR

Largest accounts 4 / 44MRR
  • 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>
  );
}

安装

$ bunx --bun shadcn add @beui-pro/mrr-movement-bridge

API 参考

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

MrrMovement14 个属性
  • months

    Months to pick from, oldest first.

    MrrMonth[]
  • monthId

    Controlled month id.

    string
  • defaultMonthId

    Month id when uncontrolled. Defaults to the latest month.

    string
  • onMonthChange

    Called with a month id when one is picked.

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

    Controlled movement whose customers are listed.

    "new" | "expansion" | "reactivation" | "contraction" | "churn"
  • defaultMovement

    Movement listed first when uncontrolled.

    "new" | "expansion" | "reactivation" | "contraction" | "churn"

    默认值 new

  • onMovementChange

    Called when a movement is chosen from the chart or tabs.

    ((kind: MrrMovementKind) => void)
  • maxRows

    Most customer rows shown at once.

    number

    默认值 4

  • colors

    Colors per movement; any movement left out keeps its default.

    Partial<Record<MrrMovementKind, MrrMovementColors>>
  • totalColor

    Fill class for the starting and ending bars.

    string

    默认值 bg-foreground/15

  • formatCurrency

    Formats full amounts, such as $74,720.

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

    Formats compact amounts on the chart and footer, such as $12.4k.

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

    Copy overrides; anything left out uses the English defaults.

    Partial<MrrMovementLabels>
  • className

    Classes merged onto the card.

    string
CustomerRow9 个属性
  • customer必填

    The customer to draw.

    MrrCustomer
  • share必填

    Bar width as a share of the largest row, 0 to 1.

    number
  • delay必填

    Entrance delay in seconds; 0 for rows that arrive after the list opens.

    number
  • reduce必填

    Skip movement, keep fades.

    boolean
  • barClassName必填

    Tinted fill behind the row, such as `bg-emerald-500/12`.

    string
  • amountClassName必填

    Amount text color, such as `text-emerald-700`.

    string
  • canceledLabel必填

    Plan shown after the arrow for churned customers.

    string
  • formatCurrency必填

    Formats the amount, such as $1,490.

    (value: number) => string
  • ref

    The 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) => void
  • movement必填

    The selected movement's data, if the month has it.

    MrrMovement | undefined
  • listKey必填

    Changes whenever the month or movement changes, to replay the row cascade.

    string
  • maxRows必填

    Most rows shown at once.

    number
  • colors必填

    Colors for each movement.

    Record<MrrMovementKind, MrrMovementColors>
  • formatCurrency必填

    Formats row amounts, such as $1,490.

    (value: number) => string
  • reduce必填

    Skip movement, keep fades.

    boolean
  • labels必填

    Copy for tabs, captions, and the empty state.

    MrrMovementLabels
MrrBridge9 个属性
  • month必填

    Month to chart.

    MrrMonth
  • kinds必填

    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) => void
  • colors必填

    Colors for each movement.

    Record<MrrMovementKind, MrrMovementColors>
  • totalColor必填

    Fill class for the starting and ending bars.

    string
  • formatCurrency必填

    Formats full amounts in the tooltip, such as $61,510.

    (value: number) => string
  • formatCompact必填

    Formats compact amounts on the axis and labels, such as $12.4k.

    (value: number) => string
  • labels必填

    Copy for bar names and tooltip captions.

    MrrMovementLabels
MrrFooter5 个属性
  • net必填

    Net new MRR for the month, signed.

    number
  • quickRatio必填

    Gains over losses: (new + expansion + reactivation) / (contraction + churn).

    number
  • churned必填

    Customers lost to churn.

    number
  • formatCompact必填

    Formats net new MRR, such as $9.3k.

    (value: number) => string
  • labels必填

    Copy for the three captions.

    MrrMovementLabels
MrrHeader7 个属性
  • months必填

    Months in the picker, oldest first.

    MrrMonth[]
  • monthId必填

    Id of the month shown.

    string
  • onMonthChange必填

    Called with a month id when one is picked.

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

    MRR at the start of the month.

    number
  • ending必填

    MRR at the end of the month.

    number
  • formatCurrency必填

    Formats the ending MRR, such as $74,720.

    (value: number) => string
  • labels必填

    Copy for the title, picker, and captions.

    MrrMovementLabels
类型5 个类型

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

MrrMonth4 个字段
  • id必填

    Unique key for the month.

    string
  • label必填

    Month name in the picker, such as "Nov 2026".

    string
  • startingMrr必填

    MRR on the first day of the month.

    number
  • movements必填

    Movements in the month. Kinds left out, or with an amount of 0, are hidden.

    Partial<Record<MrrMovementKind, MrrMovement>>
MrrMovementLabels18 个字段
  • title必填

    Card title.

    string
  • month必填

    Accessible name for the month picker.

    string
  • endingMrr必填

    Caption under the ending MRR.

    string
  • vsStart必填

    Text after the change pill.

    string
  • starting必填

    First bar of the chart.

    string
  • ending必填

    Last bar of the chart.

    string
  • chart必填

    Accessible name for the chart.

    string
  • tabs必填

    Accessible name for the movement tabs.

    string
  • amount必填

    Header over the customer amounts.

    string
  • customers必填

    Tooltip caption for the customer count.

    string
  • share必填

    Tooltip caption for the share of starting MRR.

    string
  • showing必填

    Caption above the customer rows, followed by the shown and total counts.

    string
  • netNew必填

    Footer caption for net new MRR.

    string
  • quickRatio必填

    Footer caption for the quick ratio.

    string
  • churned必填

    Footer caption for churned customers.

    string
  • canceled必填

    Plan shown for churned customers.

    string
  • empty必填

    Shown when a movement has no customers.

    string
  • kinds必填

    Name for each movement kind.

    Record<MrrMovementKind, string>
MrrMovementColors3 个字段
  • bar必填

    Fill for the bar and the legend dot, such as `bg-emerald-500`.

    string
  • row必填

    Tinted fill behind customer rows, such as `bg-emerald-500/12`.

    string
  • text必填

    Amount text color for customer rows.

    string
MrrMovement3 个字段
  • amount必填

    Signed MRR change for the month: positive for gains, negative for losses.

    number
  • customers必填

    Number of customers behind the change.

    number
  • top必填

    Largest customers behind the change, shown under the chart.

    MrrCustomer[]
MrrCustomer6 个字段
  • id必填

    Unique key for the row.

    string
  • company必填

    Company name.

    string
  • avatar必填

    Portrait URL of the account owner, shown as a round avatar.

    string
  • fromPlan

    Plan before the change; leave out for new customers.

    string
  • toPlan

    Plan after the change; leave out for churned customers.

    string
  • amount必填

    Signed MRR change from this customer, such as 640 or -399.

    number