VESYL UI

NumberInput

A number field wrapped in an InputGroup with a ghost button on the left and a ghost + button on the right. The buttons and / step by step, clamped to min/max. The native spinner is hidden. Props pass through to the underlying Input / InputGroup.

Basic

Min, max, and step

Steppers disable at the bounds; typed values are clamped on step. step can be fractional.

Sizes

Disabled

Props

PropTypeDefaultDescription
valuenumber | nullControlled value. null renders an empty field.
defaultValuenumberUncontrolled initial value.
onValueChange(value: number | null) => voidFires with the parsed number, or null when cleared.
minnumberLower bound.
maxnumberUpper bound.
stepnumber1Amount added/removed per step.
size'xs' | 'sm' | 'md' | 'lg''md'Field size (passed to InputGroup).
classNamestringClass for the outer InputGroup.
inputClassNamestringClass for the inner input.

Remaining props (id, name, placeholder, disabled, aria-*, …) pass through to the input.

Form integration

Use Form.NumberInput inside a Form.Field for React Hook Form + Zod wiring. It reads its name from the field and writes a number | null to the form value.

<Form onSubmit={handleSubmit}>
  <Form.Field name="quantity" label="Quantity">
    <Form.NumberInput min={1} max={99} />
  </Form.Field>
  <Form.SubmitButton>Save</Form.SubmitButton>
</Form>