LedgerTable
Double-entry with debit/credit columns and a balance check.
npx shadcn add @lopifi/ledger-tableExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
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.
Double-entry. Debit and credit are two separate columns, never one signed column. Collapsing them stops the reader from verifying, which is the whole purpose of double-entry. Column totals show the balance check, and a failing check is a prominent error state, not a silent discrepancy.
The shared grid model#
Every table in this family, and in statements, schedules and the close, runs on the same two primitives. An accountant doesn't distinguish between them; they come from a spreadsheet and press the arrow keys.
useGridNavfor tables that are already client components (TransactionTable).GridKeyboardwraps the ones that are deliberately server-rendered and reads the DOM they produced instead of forcing a rewrite. A 400-row statement shouldn't ship 400 rows of JavaScript to be rendered twice.- One tab stop per grid. Tab to the table, arrow within it. Arrows move,
Cmd+arrow jumps to the edge,PageUp/PageDownmove a screen,Home/Endthe row,Spaceselects,Enteropens,Escapecollapses. Shift+arrows select a block,Cmd+C copies it as TSV and HTML, so every paste target gets its best format.- The clipboard carries the value, not the presentation.
Moneystamps every figure withdata-raw, so a copied column lands in Excel as-1240.56and sums.($1,240.56)pastes as text, and a column of text does not add up. - The label column freezes. Any table wider than its container pins its row
header with
FROZEN_LABEL. Scrolling a general ledger sideways shouldn't lose the account name. - Every column sorts and drags.
ColumnHeaderfor the tables that render their own rows,TableColumnsfor the ones that render on the server. Same split, same reason asuseGridNavandGridKeyboard.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Ledger & tables
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section LedgerTable renders in, the calculators behind its figures, and the ledger payloads that feed it.
- LedgerTable, runningThe tables showcase — live, with theme, density, grayscale and reduced-motion switches.
- Journals and the general ledgerCan you get the actual general ledger out?
- 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