useField hook is used to create and manage individual form fields with full type safety and validation support.
Import
Signature
Parameters
Configuration options for the field
The form API instance this field belongs to
The field name as a dot-notation path (e.g.,
"user.name" or "users[0].email")Controls reactivity behavior:
'value': Re-renders on any value change (default)'array': Only re-renders when array length changes (useful for array fields)
Default value for this field
Default debounce time in milliseconds for async validation
If true, always run async validation even when sync validation fails
Field-level validators
Validator that runs when the field mounts
Validator that runs when the field value changes
Async validator that runs when the field value changes
Debounce time for onChange async validation
Array of field names that should trigger this field’s onChange validation
Validator that runs when the field loses focus
Async validator that runs when the field loses focus
Debounce time for onBlur async validation
Array of field names that should trigger this field’s onBlur validation
Validator that runs on form submission
Async validator that runs on form submission
Return Value
The field API instance
The field name
Reference to the parent form API
Current field state
Current field value
Field metadata
True if field has been touched
True if field has been blurred
True if field value has been modified
True if field value has not been modified
True if field is currently validating
True if field has no validation errors
Array of validation errors
Map of errors by validation event
Update the field value. Accepts a new value or updater function.
Mark the field as blurred and trigger onBlur validation
Get the current field value
Set the field value programmatically
Get the current field metadata
Set the field metadata programmatically
Push a value to the end of an array field
insertValue
(index: number, value: TData extends any[] ? TData[number] : never, opts?: UpdateMetaOptions) => void
Insert a value into an array field at a specific index
Remove a value from an array field
Swap two values in an array field
replaceValue
(index: number, value: TData extends any[] ? TData[number] : never, opts?: UpdateMetaOptions) => void
Replace a value in an array field
Manually trigger validation for this field