---
title: "RollForward"
description: "Opening → movements → closing → tie. The universal shape."
canonical: "https://lopifi.com/components/roll-forward"
---

# RollForward

> Opening → movements → closing → tie. The universal shape.

Source: https://lopifi.com/components/roll-forward
Part of: Lopifi — Your VC tech stack partner (https://lopifi.com)

---

- **Family:** Accounting core (GL) — 
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/accounting-core

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/roll-forward
```

## Specification

> **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:

```ts
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.

## Rules this component obeys

Money is minor units, never floats. `null` is not `0` and neither is redacted. Negatives render in accounting parentheses with the parenthesis column reserved on both sides. Debit and credit are two columns. Per-currency decimal places. Polarity is explicit — up is not always good. Every figure states its period, entity, currency, basis and as-of.
