Skip to content
Keyboard shortcuts
Esc
Everywhere
Search the site
⌘K
Search the site
/
Show these shortcuts
?
Close what is open
Esc
Install
195 components

GroupPicker

One cut through a table, with subtotals per group.

npx shadcn add @lopifi/group-picker

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.

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; noneLabel renames 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.
Read the Ledger & tables spec

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.

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

We don’t rent the list, and asking takes you off it. We use this to reply and to send the updates you asked for. To unsubscribe, reply to any email or write to hello@lopifi.com. See Privacy.

Or install it now

npx shadcn add @lopifi/group-picker