beUI Pro

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

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

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

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

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