MetricDefinition
Every metric requires one. Formula with values substituted.
npx shadcn add @lopifi/metric-definitionHow it behaves
What it renders, what it refuses to render, and why. The same paragraphs as the family spec, so the two can’t disagree.
Every metric card requires one. There is no variant without a definition.
Renders the formula with the actual input values substituted, plus cohort, period, source, and caveat:
Net Revenue Retention 104.6%
────────────────────────────────────────────────────────────────
(Starting MRR + Expansion − Contraction − Churn) ÷ Starting MRR
( 412,000 + 61,400 − 18,200 − 24,100 ) ÷ 412,000
Cohort: customers active on 1 Sep 2026
Period: 1–30 Sep 2026
Source: subscription ledger · excludes one-time fees
Note: new customers excluded by definition
"ARR" means four different things at four companies. This component makes sure the number here means one.
Definitions are versioned. When one changes, historical values computed under the old definition are marked. An unannounced definition change looks like a business change.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Metrics & analysis
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section MetricDefinition renders in, the calculators behind its figures, and the ledger payloads that feed it.
- MetricDefinition, runningThe metrics showcase — live, with theme, density, grayscale and reduced-motion switches.
- Margin & markupMargin is profit over price; markup is profit over cost. Solve either way.
- NPV, IRR & XIRRNPV, payback and every IRR a series has, not just the first a solver finds.
- Effective vs nominal rateTurn a nominal rate into the effective annual rate it compounds to.
- Metrics & analysisMetrics & analysis — specs for 13 React components: MetricDefinition, NonGaapReconciliation, MrrBridge, BudgetVsActual and 9 more.
Components are copied into your repository and meant to be edited. Rounding policy, fiscal calendar and compliance copy differ per company.
Release notes
Get an email when Metrics & analysis changes
Your copy doesn’t update itself when we fix something here.
- One email when a Metrics & analysis component needs a migration
- Nothing when nothing changes
Or install it now