ProfitAndLoss
P&L with period comparison and variance.
npx shadcn add @lopifi/profit-and-lossExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Budget vs. actual
Actual first, budget second: the variance pair compares the first two columns, with expense lines inverted.
Multi-month
Three months side by side, each column its own resolved period, with columns the reader can hide.
With a non-GAAP reconciliation
EBITDA sits below net income, apart from the statement, reconciled with every adjustment named.
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.
Revenue → COGS → Gross profit → Operating expenses → Operating income → Other → Net income.
- Margin rows (gross %, operating %, net %) rendered as a
Percentlevel, with their period-over-period change inpoints, styled apart from the money rows so a percentage in a column of dollars doesn't look like dollars. - Comparison modes: prior period, prior year, budget, forecast. Each with its own variance column.
- Expense rows are
polarity="inverted". An increase in COGS isn't good news, and showing it green is exactly the bug this system exists to prevent. - Optional per-line
WaterfallChartdrill-in showing what drove the change.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Statements
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section ProfitAndLoss renders in, the calculators behind its figures, and the ledger payloads that feed it.
- ProfitAndLoss, runningThe statements showcase — live, with theme, density, grayscale and reduced-motion switches.
- ReportsShould you build statements on the reports endpoints?
- StatementsNo component library ships a <BalanceSheet />. That's the biggest gap in the market, and the reason Lopifi exists. Specs for 16 React components: StatementTable, StatementRow, ProfitAndLoss, BalanceSheet and 12 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 Statements changes
Your copy doesn’t update itself when we fix something here.
- One email when a Statements component needs a migration
- Nothing when nothing changes
Or install it now