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.
Signature
Section titled “Signature”function number<const HasSource extends SlotSource | ComputeBinding<unknown> | undefined = undefined>(opts: NumberOptions & { source?: HasSource; } & WritebackOption<HasSource>): NumberSlotDef & SourceMark<HasSource>Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
opts |
NumberOptions & { source?: HasSource } & WritebackOption<HasSource> |
required |
Returns
Section titled “Returns”NumberSlotDef & SourceMark<HasSource>
Example
Section titled “Example”import { fact, number } from "@homepages/template-kit";
number({ source: fact.unit.sqft, writeback: true, label: "Square feet", thousandsSep: true, suffix: "sqft", maxDigits: 7 });