Skip to content

NumberInput

A field that allows user input of numeric values.

Please enter your age
// Import component
import { NumberInput } from '@fintech-sandpit/ui/react';
// Import styles (optional). Please note that you need to import the styles
// for Field and NumberInput components since the NumberInput component
// is using Field component.
import '@fintech-sandpit/ui/style/components/field.css';
import '@fintech-sandpit/ui/style/components/number_input.css';
return (
<NumberInput
min={18}
max={128}
step={1}
label="Age"
placeholder="E.g. 25"
hint="Please enter your age"
error="Invalid age"
/>
);
NameTypeRequiredDefaultDescription
valuestring—Controlled value of the text input
defaultValuestring—Default (uncontrolled) value of the text input
namestring—Name of the input element
orientationOrientation'vertical'Orientation of the text input
sizeFieldSize'md'Size of the text input
labelstring—Label of the text input
hintstring—Helper text of the text input
errorstring—Error text of the text input
requiredbooleanfalseWhether the text input is required
invalidbooleanfalseWhether the text input is invalid
readOnlybooleanfalseWhether the text input is read only
disabledbooleanfalseWhether the text input is disabled
placeholderstring—Placeholder of the text input
minnumber—Minimum value of the text input
maxnumber—Maximum value of the text input
stepnumber—Step value of the text input
NameTypeDescription
onValueChange(value: string) => voidEvent handler for when the value changes
type FieldSize = 'sm' | 'md' | 'lg';
type Orientation = 'horizontal' | 'vertical';