Record — Money
Anatomy
A currency label, three figures and one line of explanation. Values are already formatted by the caller; this block never subtracts balances, adds taxes, chooses a currency or substitutes zero for unavailable data.
maud_ui::blocks::record::money
Props
Generated from public Rust fields. Defaults are evaluated from the implementation.
| Prop | Type | Default | Description |
|---|---|---|---|
state | crate::blocks::state::State | Ready | Explicit presentation state; Ready preserves the ordinary content. |
title | String | "Payment" | No description |
heading | Heading | H2 | No description |
currency | String | "" | Currency label supplied from the Money value, never inferred from the theme. |
total | Figure | Figure { label: "Total", value: None } | No description |
paid | Figure | Figure { label: "Paid", value: None } | No description |
due | Figure | Figure { label: "Due", value: None } | No description |
emphasize_due | bool | true | No description |
unavailable_label | String | "Unavailable" | No description |
breakdown | Option<String> | None | No description |
actions | Markup | PreEscaped("") | Use action_row::render, or a canonical server-owned action fragment. |
Examples
light · fictional example
Payment
CAD- Total stay
- $840
- Paid
- $280
- Due at check-in
- $560
3 × $240 room nights + $120 taxes & fees. Breakfast included.
Unavailable payment summary
- Total
- Unavailable
- Paid
- Unavailable
- Due
- Unavailable
No financial values were supplied for this example.
dark · fictional example
Payment
CAD- Total stay
- $840
- Paid
- $280
- Due at check-in
- $560
3 × $240 room nights + $120 taxes & fees. Breakfast included.
Unavailable payment summary
- Total
- Unavailable
- Paid
- Unavailable
- Due
- Unavailable
No financial values were supplied for this example.
Loading, empty, error and disabled
Each example uses the block’s state prop. Empty and error are separate outcomes.
Usage and composition
Import and example
use maud_ui::blocks::{action::Action, action_row, record::money::{self, Figure, Props}};
money::render(Props {
currency: "CAD".into(),
total: Figure::new("Total stay", "$840"),
paid: Figure::new("Paid", "$280"),
due: Figure::new("Due at check-in", "$560"),
breakdown: Some("3 × $240 room nights + $120 taxes & fees".into()),
actions: action_row::render(action_row::Props {
primary: Some(Action::link("Review payment", "/bookings/14/payment")),
..Default::default()
}),
..Default::default()
});
Figure { label: String, value: Option<Markup> } defaults to an empty label and None value. Figure::new(label, value) escapes a formatted string. For a canonical field fragment, pass value: Some(field_markup) directly; preserve its classification, masking and annotations. Some(html! {}) deliberately remains empty and is not replaced. None is unavailable, while a supplied $0 is a known zero. Only include fields and actions already admitted for this viewer.
Related
Action row, record timeline, attention banner.
Presentation states (0.10.1)
Props::state: maud_ui::blocks::state::State defaults to Ready. Loading { message } shows skeletons; Empty { message, action } and Error { message, retry } provide distinct recovery paths; Disabled { reason } retains admitted content in an inert subtree with an external reason. Loading, empty and error omit ready content. Inert disables interaction, not server authorization or submission of values by an enclosing form. Each live API page shows all four states together. Add state: Default::default() to exhaustive Props literals.
State::Absent (0.11.0) means no input/rule was declared and emits nothing. Keep any caller-owned section heading inside the same conditional. Use Error only for a declared operation that failed; never show an unconfigured-rule message to the user.
Accessibility
A definition list gives each figure its label; Due remains explicit in text as well as warning color. The three figures stay together on phones, with smaller type and wrapping for long localized amounts. The same semantic tokens support light and dark themes. No JavaScript is required.