GroupPicker
One cut through a table, with subtotals per group.
npx shadcn add @lopifi/group-pickerHow 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.
Chooses how the table is cut. One cut, not a stack. Nested grouping (category inside entity inside month) leaves about four data rows on screen under three levels of headers, and what it really wants to be is a pivot table, a different tool with a different layout. One cut with a subtotal per group answers the question people actually ask.
<GroupPicker
options={[
{ key: "category", label: "Category", hint: "Subtotal per account category" },
{ key: "vendor", label: "Vendor" },
]}
value={groupBy}
onValueChange={setGroupBy}
/>
- "No grouping" is the first choice in the list and where the tick starts, not a separate
clear button. Ungrouped is a view like the others, and readers return to it constantly.
value={undefined}means it;noneLabelrenames it for the table. - The trigger says what's in force: "Grouped by vendor", not "Group". If the label never changes, the reader has to open the control to find out.
- Each option can say what its subtotal will mean (
hint), and the popover states the rule under the list: each group subtotals the rows under it, not the filtered set behind them. - The tick keeps its column whether or not it's drawn, so labels don't shift as the selection moves. Choosing closes the popover; the popover opens from its trigger.
More in Ledger & tables
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section GroupPicker renders in, the calculators behind its figures, and the ledger payloads that feed it.
- GroupPicker, runningThe tables showcase — live, with theme, density, grayscale and reduced-motion switches.
- Ledger & tablesThe table is the product. It gets the same design attention as the hero card. Specs for 17 React components: TransactionTable, TransactionRow, TransactionCard, TransactionDetail and 13 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 Ledger & tables changes
Your copy doesn’t update itself when we fix something here.
- One email when a Ledger & tables component needs a migration
- Nothing when nothing changes
Or install it now
npx shadcn add @lopifi/group-picker