RollForward
Opening → movements → closing → tie. The universal shape.
npx shadcn add @lopifi/roll-forwardExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Does not tie to the GL
The walk foots but the closing balance misses the ledger, so the difference leads the card and the close cannot proceed without a written explanation.
Walk does not foot
A closing figure typed in on its own can match the GL while the movements above it do not add up to it — the footing is checked before the tie means anything.
Opening breaks from last period
This period's opening must equal last period's closing; when a posting lands in a closed month the two drift apart, and the card says by how much.
Allowance with its own movement names
Provision, write-offs and recoveries have different P&L effects, so the allowance names them instead of collapsing them into additions and releases.
Yen subsidiary
A JPY schedule carries no decimals, and the walk, the GL and the difference all follow the currency rather than a hardcoded two places.
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 most reusable component in the accounting family. Every schedule is this shape.
Opening · + Additions · − Releases · ± Adjustments · = Closing
Closing vs. GL balance → Difference (must be zero or explained)
Asserts opening = prior closing and closing = GL. The difference is always visible; a non-zero difference becomes the main state of the screen and requires an explanation.
Every movement is passed signed and states its sign exactly once: a release that reduces the balance is negative and renders (552,000) with the paren column reserved. No operator glyph sits beside the label, since a "−" next to a parenthesized figure reads as a double negative.
The explanation is required whenever the closing doesn't tie to the GL or the walk doesn't foot. It's controlled, so the host can save it with the close:
explanation?: string; // the saved text
onExplanationChange?: (explanation: string) => void;
With both, the box is an editable textarea. With explanation alone it renders read-only, for review. With neither it is a scratch field the host never sees — don't ship that.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Accounting core (GL)
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section RollForward renders in, the calculators behind its figures, and the ledger payloads that feed it.
- RollForward, runningThe gl showcase — live, with theme, density, grayscale and reduced-motion switches.
- Depreciation scheduleStraight-line, double-declining or SYD schedules, with a first-period convention.
- Lease — ASC 842 / IFRS 16Lease liability and ROU asset schedules, finance or operating, from the payments and a rate.
- Accounting core (GL)The general ledger layer. Specs for 18 React components: JournalEntry, JournalEntryForm, JournalEntryTable, AccountPicker and 14 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 Accounting core (GL) changes
Your copy doesn’t update itself when we fix something here.
- One email when a Accounting core (GL) component needs a migration
- Nothing when nothing changes
Or install it now