Basic fields
Number
Numeric values, empty inputs, and validation limits.
z.number() produces a number input. Input text is converted with Number; clearing the input stores undefined rather than zero or an empty string.
Usage
Use your form instance from useForm. See the initial setup.
const schema = z.object({ age: z.number().min(1) });
<ErlForm
form={form}
schema={schema}
fieldConfig={{
age: { label: "Age", min: 1 },
}}
/>Empty values and bounds
Use an optional number schema if an empty value is allowed, and type defaultValues accordingly. Configure min, max, and step on the field for browser controls, for example { min: 1, max: 120, step: 1 }. Keep .min(), .max(), or .int() in the schema to validate the actual data.
The built-in number renderer remains a number input even if type is range. Use a custom component for a numeric slider.