# Ledger

> A statement of money movements grouped by day: each day a heading with its net total, each entry a row of mark, name, detail and amount that may link to its record.

```ts
import { Ledger } from "@sdxc/ui/finance";
```

Renders the statement as a column of day groups.

## Examples

```tsx
<Ledger>
	<Ledger.Day title="Today" total={<Amount value={-2340} currency="EUR" />}>
		<Ledger.Entry mark={<Avatar … />} title="Mercado Rua" meta="Groceries" amount={<Amount value={-2340} currency="EUR" sign="ledger" />} href="?tx=4" />
	</Ledger.Day>
</Ledger>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `children` | `RemixNode` | Ledger.Day groups, newest first. |

Also accepts everything in `TagProps<"div">`.


### Ledger.Day

Renders one day: a sticky heading row with the day's total at its end, over its entries.

| Prop | Type | Description |
| --- | --- | --- |
| `title` | `RemixNode` | The day's heading as the reader says it: "Today", "Yesterday", "Mon 16 Nov". |
| `total?` | `RemixNode` | The day's net movement, usually an `Amount`; omitted on a day of one entry. |
| `children` | `RemixNode` | Ledger.Entry rows, newest first. |

Also accepts everything in `Omit<TagProps<"section">, "title">`.


### Ledger.Entry

Renders one movement.

| Prop | Type | Description |
| --- | --- | --- |
| `mark?` | `RemixNode` | The merchant or person: a logo, an `Avatar` or an icon tile, about 2.5rem square. |
| `title` | `RemixNode` | Who the money went to or came from. |
| `meta?` | `RemixNode` | A quiet second line: the category, the account, a time or "Pending". |
| `amount` | `RemixNode` | The amount, usually an `Amount` with `sign="ledger"`. |
| `amountMeta?` | `RemixNode` | A quiet line under the amount: the original currency, a split share, a note mark. |
| `href?` | `string` | The record's address; the whole row becomes one link to it. |
| `current?` | `boolean` | Marks the row whose record is open beside the list. |
| `muted?` | `boolean` | Draws the row muted, for a pending or declined movement. |

Also accepts everything in `Omit<TagProps<"li">, "title">`.

