PeriodGrid
The ruled grid. Frozen panes, hidden columns, hover change, ⌘C.
npx shadcn add @lopifi/period-gridExamples
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 ruled grid: rows down, periods across, and the six spreadsheet behaviors an accountant
uses within a minute of opening a workbook. Every period-by-period surface in the system
(ForecastTable, BudgetVsActual, RevenueTracker, ExpenseTracker, DriverModel,
ScenarioCompare, PlByDimension) is a configuration of this grid, not another table written
from scratch.
Ruled cells, and why the statements are not#
A statement is read across one row at a time, and its horizontal rules carry meaning: single above a subtotal, double under a total. A period grid is read down a column as often as across, and the eye loses a column with no left edge as soon as two neighboring figures are the same width. So the grid boxes every cell, and the statements keep their accounting rules with a vertical seam between period columns.
border-collapse: separate is required. In a collapsed table a sticky cell loses its borders
when it detaches, because the border belongs to the table and the cell scrolls away from it.
Freeze panes#
Top row and left column, the two everyone freezes. The freeze shadow appears only once something is hidden behind it. A permanent shadow on a grid that fits its container hints at a scroll that can't happen.
Hidden columns#
Nobody reviews fourteen months at once. Hiding isn't deleting: rows index into the full column
list, so a hidden column never renumbers the data, and a declared comparison (column.compare)
still measures against its base while the base is off screen. The hidden-column count is always
shown with a one-click way back, because a reader who hid six columns last quarter needs to know
the grid isn't the whole story.
The change, printed under the figure#
The figure answers "how much"; the next question is always "versus what". That answer is printed under every figure at once, small, toned and right-aligned, instead of revealed cell by cell on hover. People open this grid to compare, and a comparison you can make only one cell at a time isn't one. The pointer and the keyboard cursor still fill the formula bar under the grid with the full sentence, including the amount and the column it's measured against.
The sub-line is a percentage, not an amount. The amounts are already on screen above and to the left; the percentage is what the eye can't work out while scanning seven columns. On a percentage row it shows points instead. Calling a move from 51.8% to 53.0% "+2.3%" is the most common way a deck misleads by accident.
No invented percentages. No ratio against a zero base or a negative base, and a missing figure stays missing. The sub-line says which case it was instead of printing a number that reads backwards, and the first column on screen shows an en dash, not a zero.
Annotations, not views#
Two independent toggles, % change and % of a named base row, each add a line under the figures without replacing them. A segmented Value / Δ / Δ% switch makes the reader hold one number in their head while looking at the other, and a grid that swaps its numbers for percentages on a tab press has to be re-read every time it's touched.
Typing#
Off by default. A grid over posted figures is a report, and if a report accepts typing,
someone will believe they changed it. Where a caller marks cells editable (a driver model's
projected inputs, never its actuals or computed rows), a cell opens on double-click or Enter
and accepts what a spreadsheet accepts, including 1.2k, (1,240) and =1200+340. A value it
can't parse commits nothing, not zero.
Keyboard and clipboard#
One tab stop, then arrow keys, PageUp/PageDown, Home/End, shift to extend a range and
⌘C to copy it. The clipboard carries data-raw values, so the paste sums in the spreadsheet.
API change: PeriodRow.polarity is now required, no default (rows without one previously fell back to standard). Polarity describes the figure as stored: a cost stored negative is standard, a cost stored positive is inverted, a headcount is neutral.
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 PeriodGrid renders in, the calculators behind its figures, and the ledger payloads that feed it.
- PeriodGrid, 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