RatioAnalysis
Liquidity, leverage and efficiency ratios, each with its formula and inputs.
npx shadcn add @lopifi/ratio-analysisExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Threshold breached
A credit-agreement floor, missed: said in words and an icon; the color only repeats it.
Three ways to have no value
A missing input, a zero denominator and mixed currencies each say so — never 0 or Infinity.
How 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.
Liquidity, leverage, coverage, efficiency and profitability ratios in one table, grouped in that order. Each row carries the ratio's name, its formula in words, and the two figures that produced it, so the value can be checked without opening the ledger.
The value is computed from its inputs, never passed in beside them. A ratio whose own formula line contradicts it is worse than no ratio.
- Kind is explicit:
times(1.84×),percent(34.2%) ordays(47 days). Adaysratio takes the length of the period its denominator covers — DSO on a quarter's revenue is × 91, not × 365 — so the component never guesses a year. - Polarity is required, no default. A current ratio rising is good; DSO or debt to equity rising is not.
- Change is in the ratio's own unit. A percent ratio moves in points, not percent of itself. The change is computed on the displayed precision, so it never shows a move where both readings print the same.
- Three gaps, three sentences, none of them zero: an input missing ("Input not available"), a zero denominator ("Not meaningful" — never Infinity), and inputs in two currencies ("Inputs in two currencies" — a ratio across currencies needs a rate nobody passed).
- Thresholds name their source — the credit agreement section, the board policy. A breach is
stated in words with an icon; the
--negativecolor repeats it, never replaces it. - The basis is a required prop: period, entity, currency, accounting basis. Ratios computed mid-close inherit the provisional state of their inputs; pass it in the basis line.
Not a covenant monitor: CovenantMonitor carries the contractual definition and the test date.
Use this for analysis and the covenant card for compliance.
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 RatioAnalysis renders in, the calculators behind its figures, and the ledger payloads that feed it.
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
npx shadcn add @lopifi/ratio-analysis