CategoryBreakdown
Ranked bars, not a pie.
npx shadcn add @lopifi/category-breakdownExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
With a negative category
A refunds line pushes the parts past the total, so shares are withheld, not shown wrong.
Three-decimal currency
Amounts are minor units of the currency given, so a dinar breakdown prints fils to three places.
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.
Ranked horizontal bars with values and percentages. Not a pie chart. People compare lengths well and angles badly; a pie with more than three slices is decoration.
Top N + "Other" (max 6 series). Percentages use largest-remainder allocation so they sum to exactly 100%.
More in Dashboard & charts
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section CategoryBreakdown renders in, the calculators behind its figures, and the ledger payloads that feed it.
- CategoryBreakdown, runningThe charts showcase — live, with theme, density, grayscale and reduced-motion switches.
- Dashboard & chartsWe wrap a charting engine (Recharts, or visx where we need more control) instead of building one. What we add is everything a chart library doesn't know about money. Specs for 11 React components: DashboardShell, KpiRow, MoneyChart, MoneyBarChart and 7 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 Dashboard & charts changes
Your copy doesn’t update itself when we fix something here.
- One email when a Dashboard & charts component needs a migration
- Nothing when nothing changes
Or install it now