Skip to content
HomePagesHomePages template kit

number

A numeric slot.

A numeric slot. prefix/suffix are rendered strings (such as "$" / " sq ft"), thousandsSep toggles grouping-separator formatting, decimals toggles decimal display, and maxDigits caps the digit count — all read by the renderer’s number formatting, not enforced as an input range.

Binding-only: no fill decision produces a number, so this builder takes no fill — the value comes from source.

Import from @homepages/template-kit.

function number<const HasSource extends SlotSource | ComputeBinding<unknown> | undefined = undefined>(opts: NumberOptions & { source?: HasSource; } & WritebackOption<HasSource>): NumberSlotDef & SourceMark<HasSource>
Name Type Required Description
opts NumberOptions & { source?: HasSource } & WritebackOption<HasSource> required

NumberSlotDef & SourceMark<HasSource>

import { fact, number } from "@homepages/template-kit";
number({ source: fact.unit.sqft, writeback: true, label: "Square feet", thousandsSep: true, suffix: "sqft", maxDigits: 7 });