TransactionTable
The workhorse. Virtualized, sticky, priority-collapsing.
npx shadcn add @lopifi/transaction-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.
The workhorse. Every detail of it is a deliberate choice.
Column priority#
P1 date · description · amount never dropped
P2 status · account
P3 category · merchant
P4 reference · memo · created-by · tags
Four presentations#
| Width | Presentation |
|---|---|
| ≥1280 | Full table, sticky header, sticky total footer |
| 1024–1280 | P4 dropped into a per-row expand |
| 768–1024 | Sticky description (left) + sticky amount (right), metadata scrolls between |
| <768 | TransactionCard list — a genuine re-rank |
Almost nobody builds the 768–1024 pattern, and it's what makes a wide table usable at laptop width. The label and the number stay pinned while the metadata scrolls between them, so the two things being compared are always on screen. Sticky cell backgrounds, IntersectionObserver edge fades, inner borders and unclipped focus rings are covered in responsive.
Craft#
- Virtualized past 100 rows (
@tanstack/react-virtual), with correctaria-rowcount/aria-rowindexso a screen reader knows the real total. - Amounts right-aligned,
tnum, paren column reserved, hugging the card inset. - Row heights on the grid: 32 / 40 / 48 by density.
- Zebra striping: no.
--border-subtlerow dividers instead. Striping doubles the background changes on a scrolling surface and fights hover and selection. - Selection is a checkbox column, always visible on touch, hover-or-focus-revealed on desktop.
Shift-click range select,Cmd-click toggle. - Sort is instant. No FLIP, no stagger; it happens too often. Every column sorts on its
value: amounts on minor units, status on workflow urgency instead of the alphabet, so one
click puts the exceptions on top. Uncontrolled by default. Pass
sort+onSortChangeand the host owns it, which is the only correct setup once the rows are a page of a larger set. - Columns drag. Widths are px, persisted per user under
columnStorageKey, withdescriptiontaking the slack. SeeColumnHeader. - Sticky header gains its shadow only once content scrolls beneath (sentinel +
IntersectionObserver). - Sticky total footer: one row height plus a 1px top rule. It's the number people are looking for.
- Pending rows carry a 2px
--warningleft border and their pending status, at full opacity: a row dimmed to 0.6 drops its secondary text under AA (3.2:1). Confirmation removes the border.
Keyboard#
Full grid model: arrows move between cells, and the grid is one tab stop. Table in accessibility.
Motion#
Tier 0 almost entirely. Row hover is background-color at 100ms, with no transform, shadow or lift. Insert and delete animate; sort, filter, and paginate do not.
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 TransactionTable renders in, the calculators behind its figures, and the ledger payloads that feed it.
- TransactionTable, runningThe tables showcase — live, with theme, density, grayscale and reduced-motion switches.
- Number cleanerTurn pasted amounts in any format into clean signed values, one per line.
- Two-list matcherMatch bank against ledger and list what's left unmatched on each side.
- Reading, paging and delta syncHow do you get everything out, and then keep it fresh?
- 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