NumberInput
Exact numbers: right-aligned tabular digits, a unit, steppers on hover, a decimal string value.
function Money() {
const [v, setV] = useState("1250.00");
return (
<div className="flex w-280 flex-col gap-8">
<NumberInput label="Monthly budget" value={v} onValueChange={setV} unit="USD" step="50" min="0" />
<span className="mono text-small text-fg-secondary">value = "{v}"</span>
</div>
);
}import { NumberInput } from "@logicplanes/kaeso-ui";Props
align"start" | "end" = endText alignment of the value; numbers align to the end with tabular digits.
defaultValuestringThe number on first render, as text.
descriptionReactNodeOne sentence of help under the label.
hideStepperbooleanHide the stepper circles.
invalidbooleanShows it as invalid; pair it with a message that says what to fix.
labelReactNodeThe visible label.
layout"horizontal" | "vertical"The label above the control (
vertical) or beside it (horizontal).leadingIconIconSvgElementAn icon before the text.
maxstringThe highest number allowed.
minstringThe lowest number allowed.
onValueChange((value: string) => void)Called with the number as text, as typed.
optionalbooleanAdds “Optional” to the label, for forms where most fields are required.
prefixReactNodeText before the value: "https://".
size"md" | "sm" | "lg" | "xl"The height of the input.
stepstring = 1Step for the stepper and arrow keys, as a decimal string.
suffixReactNodeText after the value: "USD", "/ min".
trailingReactNodeAny trailing element (a button, a Kbd).
unitstringUnit after the value: "USD", "tokens", "/ min".
valuestringThe exact value as a decimal string ("12.50"). Never a float.