Finance foundations
What @sdxc/ui/finance is for, the money rules its parts share, and every variable it reads.
The pieces of a banking, budgeting or wallet screen: a statement grouped by day with each day's total, and a drawn payment card that can be frozen.
They draw what the server hands them. Amounts come in as integer minor units and are written by the root `Amount`, so a figure is never a float.
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/finance";When to reach for it
- A bank or card statement, a wallet's history or a billing log that reads by day.
- A cards screen where a card is shown, frozen or picked.
- Any list of money in and out where the incoming side should read at a glance.
Shared ideas
- Minor units in, text outPass cents and an ISO code to
Amount;@sdxc/moneyparses, splits and converts them. - A statement's sign
sign="ledger"marks money in with a plus and the success tone, and money out as a plain figure. - Rows are linksWith
href, aLedger.Entryis one link, so the record opens beside the list from its address. - Masked numbers only
PaymentCardtakes the last four digits and draws the rest as dots, so a full number is never passed. - State in the nameA frozen card frosts over and its accessible name says frozen.
CSS variables
Every custom property the namespace reads or declares, with its default and what it controls.
Reads the neutral role for text, hairlines and the day headings, brand for the open row and the card face, and success for money in. The roles are documented on Theming.
Ledger
| Variable | Default | What it controls |
|---|---|---|
--ui-ledger-bg | var(--ui-bg) | The sticky day heading's background; set it to the surface the ledger sits on. |
--ui-ledger-sticky-top | 0px | Where the day heading sticks, below a sticky toolbar. |
--ui-ledger-inset | 0.75rem | The inline padding of the heading and every row. |
PaymentCard
| Variable | Default | What it controls |
|---|---|---|
--ui-payment-card-bg | the tone's gradient | The face's paint, for a card in an issuer's own colours. |
--ui-payment-card-radius | 1rem | The card's corners. |
--ui-payment-card-max | 26rem | The widest the card grows. |