# MetricDefinition

> Every metric requires one. Formula with values substituted.

Source: https://lopifi.com/components/metric-definition
Part of: Lopifi — US GAAP books on autopilot, reviewed by a CPA (https://lopifi.com)

---

- **Family:** Metrics & analysis — ---
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/13-metrics-and-analysis

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/metric-definition
```

## Specification

> **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 is why the number in this product is not one of them.

**Definitions are versioned.** When one changes, historical values computed under the old definition are marked — an unannounced definition change looks like a business change.

## Rules this component obeys

Money is minor units, never floats. `null` is not `0` and neither is redacted. Negatives render in accounting parentheses with the parenthesis column reserved on both sides. Debit and credit are two columns. Per-currency decimal places. Polarity is explicit — up is not always good. Every figure states its period, entity, currency, basis and as-of.
