<NumberField
label="Quantity"
minValue={0}
maxValue={100}
step={1}
maximumFractionDigits={0}
minimumFractionDigits={0}
value={10}
defaultValue={0}
hideControls={false}
onChange={(value) => console.log(value)}
description="Enter a quantity"
error="Invalid value"
hint="Must be between 0 and 100"
size="medium"
loading={false}
disabled={false}
readOnly={false}
required={false}
placeholder="Enter quantity"
/>
NumberField Props
Properties
Default value for uncontrolled number field.
Whether to hide the increment/decrement buttons.
Maximum number of decimal places to display and allow.
Maximum allowed value for the number field.
Minimum number of decimal places to display.
Minimum allowed value for the number field.
onChange
(value: number | null) => void
Callback fired when the value changes.
Step value for increment/decrement operations.
Controlled value of the number field.
Additional field props
The component also support the following props which are common to most field components:Descriptive text displayed below the input field
Whether the number field is disabled
errorAriaLive
"off" | "polite" | "assertive"
default:"assertive"
ARIA live region setting for error announcements
error
ReactElement | string | boolean
Error message or element to display below the input
Hint text displayed below the input field
Label text displayed above the input field
Additional props to pass to the Label component
Whether to show a loading spinner in the input field
Additional information to display with the label
Placeholder text when no value is present
Whether the number field is read-only
Whether the number field is required
size
"small" | "medium" | "large"
default:"medium"
Size variant of the number field