Ledger
A statement of money movements grouped by day.
View code
<Ledger>
<Ledger.Day title="Today" total={<Amount value={-6140} currency="EUR" />}>
<Ledger.Entry mark={<Mark letters="CL" />} title="Café Lumen" meta="Eating out · Pending"
amount={<Amount value={-340} currency="EUR" sign="ledger" />} href="?tx=1" muted />
<Ledger.Entry mark={<Mark letters="TR" />} title="Tasca do Ribeiro" meta="Eating out · Split 3 ways"
amount={<Amount value={-5800} currency="EUR" sign="ledger" />}
amountMeta={<>You: <Amount value={-1933} currency="EUR" /></>} href="?tx=2" current />
</Ledger.Day>
<Ledger.Day title="Yesterday">
<Ledger.Entry mark={<Mark letters="AN" />} title="Atelier Norte" meta="Income"
amount={<Amount value={210000} currency="EUR" sign="ledger" />} href="?tx=3" />
</Ledger.Day>
</Ledger>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { Ledger } from "@sdxc/ui/finance";Renders the statement as a column of day groups.
Composition
The parts the component publishes, each a static property of the host.
LedgerLedger.DayRenders one day: a sticky heading row with the day's total at its end, over its entries.Ledger.EntryRenders one movement.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
children | RemixNode | Yes | Ledger.Day groups, newest first. |
Also accepts everything in TagProps<"div">.
Ledger.Day
| Prop | Type | Required | Description |
|---|---|---|---|
title | RemixNode | Yes | The day's heading as the reader says it: "Today", "Yesterday", "Mon 16 Nov". |
total | RemixNode | No | The day's net movement, usually an Amount; omitted on a day of one entry. |
children | RemixNode | Yes | Ledger.Entry rows, newest first. |
Also accepts everything in Omit<TagProps<"section">, "title">.
Ledger.Entry
| Prop | Type | Required | Description |
|---|---|---|---|
mark | RemixNode | No | The merchant or person: a logo, an Avatar or an icon tile, about 2.5rem square. |
title | RemixNode | Yes | Who the money went to or came from. |
meta | RemixNode | No | A quiet second line: the category, the account, a time or "Pending". |
amount | RemixNode | Yes | The amount, usually an Amount with sign="ledger". |
amountMeta | RemixNode | No | A quiet line under the amount: the original currency, a split share, a note mark. |
href | string | No | The record's address; the whole row becomes one link to it. |
current | boolean | No | Marks the row whose record is open beside the list. |
muted | boolean | No | Draws the row muted, for a pending or declined movement. |
Also accepts everything in Omit<TagProps<"li">, "title">.