Field
Accessible labels, messages, and validation state for form controls
Field connects labels, controls, descriptions, validation, and error messages across web and native forms.
Features
Automatic label, description, error, and control association
Validation functions and Standard Schema libraries
Shared validation state across web, iOS, and Android
Behavior-only components with app-owned styling
Field groups a control with its accessible name, supporting messages, and validation state. It works on its own for common forms and can also sit under React Hook Form or another form library.
The package has no visual defaults. Style its parts directly or copy a small skin into your app.
Installation
Field is already installed in tamagui, or you can install it independently:
yarn
npm
bun
pnpm
Usage
Controls integrate through useFieldControl(). The hook is also the extension
point for custom inputs:
Outside a Field, useFieldControl() returns a stable no-op contract. A shared
control can consume it without adding a wrapper check or a second render path.
Validation
Pass a function that returns one error, several errors, or null:
Async validators are supported. They never delay a submit. Field uses monotonic validation commits, so a slow response for an old value cannot replace a newer result.
Field also accepts a Standard Schema directly. Zod 4, Valibot, and ArkType implement this interface:
valid is intentionally tri-state:
nullmeans the field has not been evaluated.truemeans the latest validation passed.falsemeans the field is invalid.
Pristine fields do not emit valid or invalid state. A missing required value is also suppressed until the user edits the field or tries to submit the form.
Validation modes
validationMode can be set on Form and overridden by a Field:
onSubmitis the default. After the first submit attempt, that field revalidates as its value changes.onBlurvalidates when focus leaves the control.onChangevalidates on every change. UsevalidationDebounceTimeto delay expensive checks.
Styling field state
Every Field part emits data-valid, data-invalid, data-touched,
data-dirty, data-filled, data-focused, and data-disabled on web.
The same keys are published through FieldStyledContext on native and web.
Groups with Field.Item
Use Field.Item when one logical field owns several controls. Each item gets
its own label and description while sharing the root field state.
Anatomy
API reference
Field
Contains the field state and validation behavior. It accepts Tamagui Props, plus:
Props
name
string
The key used when Form projects submitted values and external errors.
disabled
boolean
Default:
falseDisables the field and its integrated controls.
invalid
boolean
Default:
falseMarks the field invalid without running its validator. Useful for errors known before validation runs.
validate
FieldValidator | StandardSchemaV1
Validates the field value. Functions receive (value, formValues).
validationMode
'onSubmit' | 'onBlur' | 'onChange'
Default:
'onSubmit'Overrides the surrounding Form validation mode.
validationDebounceTime
number
Default:
0Milliseconds to debounce validation in onChange mode.
Field.Label
An accessible label. It is associated with the current item control automatically. On native, pressing it focuses the registered control.
Accepts Tamagui Props.
Field.Description
Supporting text added to the control description. Associations continue to work when the message is rendered through a portal.
Accepts Tamagui Props.
Field.Error
Renders the current validation or Form error when the field is invalid.
Props
match
boolean | keyof FieldValidityState
Shows for all errors by default, for one ValidityState key, or always when true.
Field.Item
Creates label and description scope for one member of a grouped field.
Props
disabled
boolean
Default:
falseDisables this item while retaining the root field state.
useFieldState
Returns the current value, errors, validity, and the touched, dirty,
filled, focused, and disabled flags.
useFieldControl
Returns the control integration contract: name, disabled, ariaProps,
dataProps, focus/change reporters, and registerControl.