A money calculator that drops into any page. Pick loan, mortgage, savings growth or subscription saving, and the module swaps its inputs, its results and its year-by-year table to match. Currency, separators and decimals are yours to set. No dependencies, no jQuery.
The first demo below is the module untouched. The three after it change only style fields — typeface, colour, radius, border weight, shadow, track and handle — to show how far the same module moves without a line of CSS.
Every style field left at its shipped default: neutral-800 on white, a 14px card, 10px panel, 8px fields, a 4px track with a 24px handle, and one sans face. The only override is style.container.max_width, set to line the card up with the text on this page. Everything below changes those same fields and nothing else — this is the baseline they are measured against.
A terminal-adjacent reading. typography.base_font and heading_font both go to IBM Plex Mono, so the figures line up in columns. container_radius and panel_radius drop to 2 and bar_radius to 0 for square corners; track_height thins to 2px; the palette moves to a cool slate (#0d1117 card, #161b22 panel, #30363d rules) and focus_color becomes a blue #58a6ff that only shows on keyboard focus. Hover lifts the button surface to #30363d. Tax and insurance are on, so the chart splits three ways and the amortisation table opens on load.
Warm paper and a display face. heading_font goes to Fraunces with base_font on Work Sans, heading_size up to 30. container_radius opens to 20 and panel_radius to 16, control_radius to 12 — rounded, and stopping well short of a pill so the number stays in a field and not a lozenge. container_shadow is medium with a brown shadow_color; the track thickens to 6px and takes a #7a5c3e fill. Panels are stacked, and the currency is a euro after the number with dot thousands and comma decimals — the number boxes follow the same setting, so the rate reads 3,6.
Soft and friendly. base_font and heading_font both go to Manrope, result_primary_size up to 48. border_width doubles to 2px against a lilac #e4e4f7, container_radius opens to 24 and panel_radius to 18, and container_shadow goes large with an indigo shadow_color. The track thickens to 8px with a #4f46e5 fill and a 3px handle border; focus_ring_width goes to 3. Hover tints the button #eeedff. The chart becomes two compare bars, the count-up is off so figures snap, and prices carry two decimals.
content.calc_mode, switches the module between loan, mortgage, savings and subscription. The inputs, the result rows, the chart and the table all change with it. In the page editor, each preset shows only its own field groups.calc_mode. Loan / auto payment, Mortgage, Savings growth, Subscription / cost saving.Each preset has its own group of sliders, and each slider carries the same fields: Label, Minimum, Maximum, Step, Starting value, and on the non-money sliders a Unit shown after the value.
Every preset has a matching labels group so no text is fixed in the markup: the headline label and its caption, one label per breakdown row, the chart legend, and the column headers for the year-by-year table.
Maximum width, padding, background, border colour, border width, corner radius, shadow (none, small, medium, large), shadow colour, and the gap between the input and result panels.
A base font and a heading font, each a font picker. The base font inherits from the host theme's body font when the module is dropped into a theme that sets one. Independent sizes for the heading, subheading, input label, input value, headline result, breakdown row, caption, table and disclaimer.
Gap between inputs, slider track height, handle size, handle radius, handle border width, field corner radius, number field height and number field width.
Results panel padding and radius, gap between rows, chart height, chart radius, gap between chart segments, table row height and the table's maximum height before it scrolls.
A spacing unit that every internal gap is derived from, plus the tablet and mobile breakpoints.
<label> tied to the number input, and the slider carries the same text as its ARIA label.aria-expanded and aria-controls pointing at the table, and its text changes between the show and hide strings.focus-visible, in a colour you set.prefers-reduced-motion: reduce, the count-up is skipped and the transitions on the chart, buttons and handles are switched off.<th scope="col"> headers taken from fields.max_width to match this page's text column. Sans face, 14/10/8 radii, 1px neutral-200 rules, 4px track, 24px handle. Side by side at 58/42, dollar before the number, no decimals, table closed, count-up 600ms.demo_loan, demo_mortgage, demo_savings, demo_subscription. Each instance name is unique so the overrides stay with the instance they belong to.