React Native · Components
Form
Form: collects field values, validates them with a schema and distributes errors to fields.
Import
Form
componentForm: collects field values, validates them with a schema and distributes errors to fields. Same API and the same rules as Form on web; values are kept in memory by field name instead of an HTML form. Each field subscribes only to its own name, so in long forms other fields do not re-render while typing.
Giving name to the fields inside (TextField, NumberInput, Select, Checkbox, DatePicker… all of them) is enough: the value, error, required (*) and disabled state come from the form. Submitting is done with SubmitButton or submit() on the ref.
Examples
FieldArray
componentRepeated form rows with a ready-made look: title, rows, delete/duplicate buttons, reordering by dragging the handle, add button, empty state and the array's error. Same API as FieldArray on web; the logic is useFieldArray.
- When a row is added its first field is focused; adding and deleting are announced.
min/maxlock the buttons automatically.sortable: drag the handle; move up/down with a screen reader.
Examples
SubmitButton
componentButton that submits the form: validates and submits when pressed; shows loading while submitting. Inactive while the form is loading or disabled.
Examples
SchemaForm
componentGenerates a form from a schema or a JSON definition: fields, labels, required marks, validation and sections in one component. The same definition format as SchemaForm on web (FormFieldConfig); the same JSON definition works on both platforms.
- Types:
text,email,password,url,textarea,number,select,multiselect,autocomplete,radio,checkbox,switch,date,datetime,daterange,time,file,slider,rating,tags,otp,array,hidden. New types are added withcomponents. - Conditional fields with
when:{ field: "type", equals: "corporate" }. - Titled sections with
sections, a step-by-step wizard withsteps; multiple columns on a tablet withcolumns. - Mobile: the right keyboard for email/URL fields, auto-capitalization off.
Examples
useFieldArray
functionRepeated rows inside a Form (invoice items, phone numbers, education history): add, delete, move, duplicate. Same API as useFieldArray on web. Values live in the form's store as an array; when rows are reordered, what was typed moves with the row.
For a ready-made look see FieldArray; this hook is for your own layout.
Examples
readFormDraft
functionReads a stored draft (e.g. to show "draft available" in a list).
clearFormDraft
functionDeletes a stored draft.
useForm
functionTo control the enclosing Form from code (e.g. a "Save" button in the screen header). Returns null outside a form.
Examples
useFormValue
functionWatches the value of a field in the form; re-renders when it changes (e.g. to show another field based on a choice). Without a name all values are returned.
Examples
useFormPending
functionWhether the form is submitting. false outside a form.
useFormField
functionTo bind your own field component to the form: value, error, required and disabled state. All built-in fields use it. Returns null outside a form or without a name.
Examples
translateText
functionReturns the translation if the text is a dictionary key, otherwise the text itself ("login.title" → "Sign in"; "Full name" → "Full name").
humanizeValue
functionGenerates a readable label from an option value: "istanbul" → "Istanbul", "corporateAccount" → "Corporate account". Values starting with an uppercase letter ("TR") or containing digits or dots stay as they are.
localizeOptions
functionDisplay labels of options. Order: a label that is a dictionary key → prefix.field.options.value → optionsKey.value → label → label generated from the value.
localizeField
functionTranslates the texts of a field definition (label, description, tooltip, placeholder, options) from the dictionary. Text without a dictionary entry stays as is, so the schema can contain both plain text and keys.
Examples
localizeSection
functionTranslates the title and description of a section or step.
parseFieldName
functionConverts a field name to a path: "address.city" → ["address", "city"], "items[0].name" → ["items", 0, "name"], "tags[]" → ["tags", undefined].
formatFieldName
functionConverts a path to a field name: ["items", 0, "name"] → "items[0].name".
getIn
functionReads a value from an object by field name: getIn(values, "address.city").
humanizeName
functionGenerates a label from a name: "birthDate" → "Birth date", "address.city" → "City".
deriveFromJsonSchema
functionDerives field definitions from a JSON Schema. Objects are flattened with parent.child names; property order is preserved.
toJsonSchema
functionReturns the schema's JSON Schema (via Standard JSON Schema; otherwise null). Computed once per schema.
deriveFields
functionDerives field definitions from a schema (one that offers Standard JSON Schema, such as Zod 4.2+). The label comes from title (.meta({ title })), the description from description (.describe()), field settings from .meta({ ui: { … } }).
Derivation rules:
- string →
text;email/url/date/timeformats map to their own type;maxLength> 200 →textarea. - enum →
radiowith 3 or fewer options, otherwiseselect. - number →
number(min/max); no decimals for integers. - boolean →
checkbox;z.literal(true)is a required checkbox. - enum array →
multiselect, string array →tags, object array →array(row fields infields; add, remove, drag to reorder). - object → its fields named
parent.child.
Examples
isFieldVisible
functionDoes the field's condition match?
issuesToErrors
functionConverts Standard Schema issues into errors by field name. An error on an array item (e.g. tags[2]) is also written under the array's own name (tags), so arrays shown as a single field also show the error.
validateValues
functionValidates values with a schema. Returns synchronously for sync schemas and a Promise for async ones.
UseFieldArrayOptions
interfaceOptions of useFieldArray.
| Name | Type | Default | Description |
|---|---|---|---|
name | string | Field name of the array ("items"). Names of the fields in rows are generated with row.name("name") as items[0].name; schema errors come with the same name. For nested arrays use row.name("options"). | |
defaultValue? | readonly T[] | Initial rows. Defaults to the array in the form's defaultValues. | |
emptyItem? | T | (() => T) | {} | Initial value of a new row (e.g. { quantity: 1 }); a function is called on every add. Give "" for single-value rows (tags[0]). |
min? | number | 0 | Minimum rows; empty rows are added if there are fewer initially, and it cannot be deleted below this. |
max? | number | Maximum rows; no adding when full. | |
focusOnAdd? | boolean | true | Focuses the first field in a row when it is added. |
FieldArrayRow
interfaceAn item of useFieldArray fields: one row.
| Name | Type | Description |
|---|---|---|
key | string | The row's stable key; pass it as key (not the index). |
index | number | Its current index (from 0). |
name | (path?: string) => string | Name of a field in the row: row.name("name") → "items[0].name". Without an argument, the row's own name ("items[0]"). |
value | T | undefined | The row's current value. |
error | string | undefined | Error belonging to the row itself (e.g. the row object's refine). |
FieldArrayAddOptions
interfaceAdd options of useFieldArray.
| Name | Type | Default | Description |
|---|---|---|---|
focus? | boolean | focusOnAdd | Focus the first field of the new row. |
FieldArrayApi
interfaceResult of useFieldArray.
| Name | Type | Description |
|---|---|---|
name | string | Name of the array. |
fields | FieldArrayRow<T>[] | Rows, in order. |
length | number | Row count. |
append | (value?: T, options?: FieldArrayAddOptions) => void | Adds a row at the end. Uses emptyItem if no value is given. |
prepend | (value?: T, options?: FieldArrayAddOptions) => void | Adds a row at the start. |
insert | (index: number, value?: T, options?: FieldArrayAddOptions) => void | Adds a row at index index. |
remove | (index: number | readonly number[]) => void | Deletes the row (or rows); does not go below min. |
move | (from: number, to: number) => void | Moves a row from from to to; the values go with the row. |
swap | (a: number, b: number) => void | Swaps two rows. |
duplicate | (index: number, options?: FieldArrayAddOptions) => void | Copies a row with its current values right below it. |
replace | (values: readonly T[]) => void | Replaces all rows with the given ones. |
getValues | () => T[] | Current values of the rows. |
canAdd | boolean | max is not reached. |
canRemove | boolean | Above min. |
error | string | undefined | Error belonging to the array itself (e.g. "Add at least one item"). |
FieldArrayProps
interfaceProps of the FieldArray component.
| Name | Type | Default | Description |
|---|---|---|---|
label? | ReactNode | Group title. | |
description? | ReactNode | Description below the title. | |
children | (row: FieldArrayRow<T>, array: FieldArrayApi<T>) => ReactNode | The fields of one row. Give names with row.name("name"). | |
sortable? | boolean | Rows are reordered by dragging the handle. See SortableList. | |
removable? | boolean | true | Row delete button. |
duplicable? | boolean | Button that copies a row with its values. | |
addLabel? | ReactNode | "Ekle" | Add button text. |
footer? | false | ((array: FieldArrayApi<T>) => ReactNode) | Your own footer instead of the add button; hidden with false. | |
empty? | ReactNode | "Henüz satır yok" | When there are no rows. |
rowLabel? | (row: FieldArrayRow<T>) => string | "{sıra}. satır" | Readable name of a row (in the delete button, announcements). |
rowVariant? | "card" | "plain" | "card" | Row look: card a bordered box, plain only rows. |
rowStyle? | StyleProp<ViewStyle> | Style of the row box. | |
disabled? | boolean | Disables everything. | |
style? | StyleProp<ViewStyle> | Container style. | |
name | string | Field name of the array ("items"). Names of the fields in rows are generated with row.name("name") as items[0].name; schema errors come with the same name. For nested arrays use row.name("options"). | |
defaultValue? | readonly T[] | Initial rows. Defaults to the array in the form's defaultValues. | |
emptyItem? | T | (() => T) | {} | Initial value of a new row (e.g. { quantity: 1 }); a function is called on every add. Give "" for single-value rows (tags[0]). |
min? | number | 0 | Minimum rows; empty rows are added if there are fewer initially, and it cannot be deleted below this. |
max? | number | Maximum rows; no adding when full. | |
focusOnAdd? | boolean | true | Focuses the first field in a row when it is added. |
FormState
interfaceForm state returned by the server (or your own code). Only errors and formErrors are read. The same shape as FormState on web; the same API response can be passed directly on both platforms.
| Name | Type | Description |
|---|---|---|
errors? | Record<string, string | readonly string[] | undefined> | null | undefined | Error messages by field name (name). With an array the first message is shown (compatible with Zod's flatten().fieldErrors shape). |
formErrors? | readonly string[] | null | undefined | Errors belonging to no field; shown in a box above the form. |
FormDraftStorage
interfaceWhere the draft is stored. createStorage() (@yasinsensoy/native/storage) can be passed directly; for another store providing these three methods is enough.
| Name | Type | Description |
|---|---|---|
get | (key: string): unknown | Reads an entry. |
set | (key: string, value: never): void | Writes an entry (a JSON-serializable value). |
remove | (key: string): void | Deletes an entry. |
FormDraftOptions
interfaceForm draft options.
| Name | Type | Default | Description |
|---|---|---|---|
key | string | Storage key; must be unique for each form with a draft. | |
storage? | FormDraftStorage | Where to store it. If omitted it is kept in memory while the app stays open (it comes back when the screen is closed and reopened). Pass createStorage() so it survives the app closing. | |
exclude? | readonly string[] | Field names not to write to the draft. Password, file and signature fields are never written. | |
maxAge? | number | 7 days | A draft older than this is not restored (milliseconds). |
FormLoadingMode
typeHow the Form looks while loading (same as web).
skeleton: fields and labels turn into muted boxes in the same place and size; nothing shifts when the data arrives.disabled: all fields and buttons are disabled.overlay: a semi-transparent scrim that blocks touches covers the form, with a spinner in the middle.
FormLoadingOptions
interfaceDetailed options of FormProps.loading.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | FormLoadingMode | "skeleton" | Look. See FormLoadingMode. |
text? | ReactNode | overlay: text next to the spinner. | |
animation? | SkeletonAnimation | "pulse" | skeleton: animation of the boxes. |
delay? | number | 0 | overlay: delay before the scrim appears (ms). |
FormSubmitLoadingOptions
interfaceDetailed options of FormProps.submitLoading.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | "disabled" | "overlay" | "disabled" | Look. |
text? | ReactNode | overlay: text next to the spinner (e.g. "Saving…"). | |
delay? | number | 150 | overlay: delay before the scrim appears (ms). |
FormHandle
interfaceThe Form ref and the useForm result: controls the form from code.
| Name | Type | Description |
|---|---|---|
submit | (): Promise<boolean> | Validates and calls onValidSubmit if valid. If invalid, focuses the first invalid field. Returns true if submitted. |
reset | (values?: Partial<Values> | Record<string, unknown>): void | Resets the values to the initial ones (or the given ones), clears errors and the draft. |
getValues | (): Record<string, unknown> | Current values (a nested object). |
getValue | (name: string): unknown | Value of a field. |
setValue | (name: string, value: unknown): void | Changes the value of a field. |
setErrors | (errors: FormState["errors"]): void | Sets external errors on fields (e.g. a server response). Cleared when the user changes the field. |
focus | (name: string): void | Focuses a field. |
pending | boolean | Whether a submit is in progress. |
FormProps
interfaceProps of the Form component.
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<FormHandle<FormValues<Schema>>> | Control from code. See FormHandle. | |
schema? | Schema | Validation schema: Zod, Valibot, ArkType… (any library supporting Standard Schema). No extra package needed. The same rules as web: - Fields validate as you type; the message shows below the field when the user leaves it or tries to submit. - If invalid it is not submitted and the first invalid field is focused. - An error is matched to a field by its name (name) and the schema path: address.city, items[0].name. Errors without a field show above the form. - If the schema provides Standard JSON Schema (Zod 4.2+), * is added to the labels of required fields automatically. - Async schemas are supported. On native values already have their types (a number field is a number, a checkbox a boolean); no conversion is needed. | |
onValidSubmit? | (data: FormValues<Schema>, values: Record<string, unknown>) => unknown | Called when the schema passes; data is the schema's output (typed). If async, the SubmitButton shows loading until it finishes. If it throws, the input is kept and the message is shown above the form. | |
defaultValues? | Partial<StandardSchemaV1.InferInput<Schema>> | Record<string, unknown> | Initial values of the fields, by field name ({ name: "Jane", address: { city: "Izmir" } }). A defaultValue given to the field itself wins. | |
onValuesChange? | (values: Record<string, unknown>, name: string | null) => void | Called on every value change (while typing). | |
draft? | string | FormDraftOptions | Stores the input as a draft; it comes back when the screen is closed and reopened (and even when the app closes if a storage is given). Deleted on a successful submit and on reset. A string is the storage key. See FormDraftOptions. | |
onDraftRestore? | (values: Record<string, unknown>) => void | Called when a draft is restored (e.g. for a "Draft restored" toast). | |
onValidationError? | (errors: FormErrors, formErrors: string[]) => void | To see schema errors before they are distributed to the fields. | |
state? | FormState | null | State returned by the server. errors are distributed to fields by name, formErrors are shown above the form. See FormState. | |
loading? | boolean | FormLoadingMode | FormLoadingOptions | Shows the form as loading: true or "skeleton" turns fields into muted boxes, "disabled" disables them all, "overlay" puts a scrim over it that blocks touches. When skeleton ends, the defaultValues given at that moment are applied to the fields (if the user typed nothing). | |
submitLoading? | boolean | "disabled" | "overlay" | FormSubmitLoadingOptions | false` (only the {@link SubmitButton} shows loading) | Look of the form while submitting (while an async onValidSubmit runs): "disabled" (or true) disables the fields, "overlay" puts a scrim. If loading is given, it wins. |
errorDisplay? | ErrorDisplay | "message" | Error display style of all fields in the form. A field's own errorDisplay overrides it. See ErrorDisplay. |
disabled? | boolean | Disables all fields. | |
children? | ReactNode | Fields, buttons. | |
style? | StyleProp<ViewStyle> | Container style. | |
testID? | string | Test id. |
Props of SubmitButton: the same as Button.
FormFieldType
typeBuilt-in field types.
FormTranslator
interfaceTranslator: the result of useT or i18n.getT() (t and t.has).
| Name | Type | Description |
|---|---|---|
has | (key: string): boolean | Whether the key exists in the dictionary. |
StandardSchemaV1
interfaceStandard Schema interface (v1). Schemas from libraries such as Zod, Valibot and ArkType satisfy it out of the box.
LocalizeOptions
interfaceTranslation options.
| Name | Type | Description |
|---|---|---|
prefix? | string | Dictionary root for field texts. With "forms.signup", these keys are looked up for the city field: - forms.signup.city (label when it is a string) or forms.signup.city.label - forms.signup.city.description, .placeholder, .tooltip - forms.signup.city.options.istanbul (option label) |
FormFieldOption
typeOption: a string or { value, label }.
ErrorDisplay
typeHow a field error is shown. Set with the field's errorDisplay prop, Form errorDisplay and UIProvider errorDisplay; the nearest one wins.
"message": the message is written below the field (classic). When an error appears the field grows by one line; elements below shift."reserve": the message is still below, but one line of space is reserved up front; nothing shifts when an error appears (the field grows for messages longer than two lines)."icon": a red ⓘ icon appears left of the label and the message shows in a tooltip (on hover, on field focus, or on tap on mobile). The field size never changes. Screen readers still read the message as the field's description (aria-describedby)."icon-end": like"icon", with the icon right of the label.
FormFieldCondition
interfaceCondition for showing the field (can be written as JSON). When several keys are given, all of them must match.
| Name | Type | Description |
|---|---|---|
field | string | Name of the field to look at. |
equals? | unknown | Visible when the value equals this. |
notEquals? | unknown | Visible when the value does not equal this. |
in? | readonly unknown[] | Visible when the value is one of these. |
filled? | boolean | true: visible when the field is filled, false: when it is empty. |
FormFieldConfig
interfaceDefinition of a single form field. Definitions without functions can be stored as JSON and sent from the server.
| Name | Type | Default | Description |
|---|---|---|---|
name | string | Field name; may be nested ("address.city"). | |
type? | FormFieldType | (string & {}) | "text" | Field type. Not needed when it can be derived from the schema. |
label? | string | Label. Defaults to the schema's title or text generated from the name. If it is a dictionary key ("login.email") its translation is shown and updated when the language changes; otherwise it is shown as is. | |
description? | string | Help text. Defaults to the schema's description. | |
tooltip? | string | ⓘ tooltip next to the label. | |
placeholder? | string | Placeholder. | |
required? | boolean | Required (asterisk on the label, browser validation). | |
disabled? | boolean | Disabled. | |
options? | readonly FormFieldOption[] | Options (select, multiselect, radio, autocomplete, tags). An option without a label gets one generated from its value ("newYork" → "New york"); a label that is a dictionary key is translated. | |
optionsKey? | string | Dictionary root for option labels: with "cities", the label of the istanbul option comes from the cities.istanbul key. Useful for translating the same list in many forms. | |
min? | number | string | Minimum value (number, slider, date). | |
max? | number | string | Maximum value. | |
step? | number | Step. | |
minLength? | number | Minimum characters. | |
maxLength? | number | Maximum characters. | |
defaultValue? | unknown | Initial value (can also be given with Form defaultValues). | |
span? | number | "full" | 1 | How many grid columns it spans (when columns > 1). "full" spans the row. On narrow screens every field is full width. |
when? | FormFieldCondition | readonly FormFieldCondition[] | ((values: Record<string, unknown>) => boolean) | Visible (and submitted) only when the condition matches. | |
props? | Record<string, unknown> | Extra props passed as is to the field component (e.g. { rows: 5 }). | |
hidden? | boolean | Hide (to not show a field coming from the schema). | |
fields? | readonly FormFieldConfig[] | Fields of a row for the array type; names are relative to the row ("name", "address.city"). Rows are added, removed and reordered by dragging with FieldArray (disable with props: { sortable: false }). min/max limit the row count. Derived automatically from an array of objects in the schema (z.array(z.object(...))). | |
columns? | number | Column count of the row fields for the array type (single column on narrow screens). |
JsonSchemaConverter
interfaceStandard JSON Schema converter.
| Name | Type | Description |
|---|---|---|
input | (options: { /** Target version. */ readonly target: string; /** Library-specific options. */ readonly libraryOptions?: Record<string, unknown>; }) => Record<string, unknown> | JSON Schema of the input side of the schema. |
FormValues
typeValue type produced by a form schema.
FormErrors
typeError messages by field name (name). Same shape as FormState errors; can be returned directly from a server action.
FormValidation
typeResult of validateForm.
| Name | Type | Description |
|---|---|---|
success | true | false | Values are valid. |
data? | Output | undefined | Value returned by the schema (transformed, typed). |
errors? | undefined | FormErrors | Empty on success. |
formErrors? | undefined | string[] | Empty on success. |
FormSection
interfaceField group: a titled section or a wizard step.
| Name | Type | Description |
|---|---|---|
title? | string | Section title (step name in a wizard). |
description? | string | Description. |
fields | readonly (string | FormFieldConfig)[] | Fields of the section: a name (from the schema) or a definition. |
columns? | number | Column count in this section. |
optional? | boolean | Optional step in a wizard (Skip button). |
FormFieldMeta
typeField settings that can be written into the schema with .meta({ ui: … }).
JsonSchema
typeSimplified JSON Schema node.
| Name | Type | Description |
|---|---|---|
type? | string | string[] | Type ("string", "number"…) or a list of types. |
properties? | Record<string, JsonSchema> | Object properties. |
required? | string[] | Required property names. |
items? | JsonSchema | Schema of the array items. |
prefixItems? | JsonSchema[] | Tuple items. |
anyOf? | JsonSchema[] | At least one of the options. |
oneOf? | JsonSchema[] | Exactly one of the options. |
allOf? | JsonSchema[] | All of them at once. |
enum? | unknown[] | Allowed values. |
const? | unknown | The single allowed value. |
$ref? | string | Reference to another definition. |
$defs? | Record<string, JsonSchema> | Definitions. |
definitions? | Record<string, JsonSchema> | Definitions (old name). |
default? | unknown | Default value. |
Custom field renderer: takes the definition and returns the field.
SchemaFormProps
interfaceProps of the SchemaForm component.
| Name | Type | Default | Description |
|---|---|---|---|
fields? | readonly (string | FormFieldConfig)[] | Fields and their order. With a name the definition is derived from the schema; with a definition it is written over the derived one ({ name: "role", type: "radio" }). If omitted all fields in the schema are shown in order. | |
sections? | readonly FormSection[] | Splits fields into titled sections (instead of fields). | |
steps? | readonly FormSection[] | Splits fields into wizard steps: each section becomes a Wizard step, and that step is validated with the schema when moving forward. | |
wizard? | Omit<WizardProps<Schema>, "steps" | "schema" | "onComplete" | "defaultValues" | "draft" | "state"> | Extra props passed to the Wizard when a wizard is used. | |
columns? | 1 | 2 | 3 | 4 | 1 | Column count on wide screens (tablet, landscape); always a single column on a phone in portrait. |
translate? | FormTranslator | Function that translates texts (t and t.has). Labels, descriptions, placeholders, option names and section titles are translated if they are a key in the dictionary. | |
i18nPrefix? | string | Dictionary root of the field texts ("forms.signup" → forms.signup.city.label). | |
submitLabel? | ReactNode | "Gönder" | Submit button text. |
resetLabel? | ReactNode | true | Reset button: true with the default text, a string with that text. | |
hideSubmit? | boolean | Hide the submit button (if you put your own button in children). | |
components? | Partial<Record<string, FormFieldRenderer>> | Custom field renderers by type ({ iban: (f) => <TextField {...f} mask="iban" /> }). | |
children? | ReactNode | Shown after the fields, before the buttons. | |
ref? | Ref<FormHandle<FormValues<Schema>>> | Control from code. See FormHandle. | |
schema? | Schema | Validation schema: Zod, Valibot, ArkType… (any library supporting Standard Schema). No extra package needed. The same rules as web: - Fields validate as you type; the message shows below the field when the user leaves it or tries to submit. - If invalid it is not submitted and the first invalid field is focused. - An error is matched to a field by its name (name) and the schema path: address.city, items[0].name. Errors without a field show above the form. - If the schema provides Standard JSON Schema (Zod 4.2+), * is added to the labels of required fields automatically. - Async schemas are supported. On native values already have their types (a number field is a number, a checkbox a boolean); no conversion is needed. | |
onValidSubmit? | (data: FormValues<Schema>, values: Record<string, unknown>) => unknown | Called when the schema passes; data is the schema's output (typed). If async, the SubmitButton shows loading until it finishes. If it throws, the input is kept and the message is shown above the form. | |
defaultValues? | Partial<StandardSchemaV1.InferInput<Schema>> | Record<string, unknown> | Initial values of the fields, by field name ({ name: "Jane", address: { city: "Izmir" } }). A defaultValue given to the field itself wins. | |
onValuesChange? | (values: Record<string, unknown>, name: string | null) => void | Called on every value change (while typing). | |
draft? | string | FormDraftOptions | Stores the input as a draft; it comes back when the screen is closed and reopened (and even when the app closes if a storage is given). Deleted on a successful submit and on reset. A string is the storage key. See FormDraftOptions. | |
onDraftRestore? | (values: Record<string, unknown>) => void | Called when a draft is restored (e.g. for a "Draft restored" toast). | |
onValidationError? | (errors: FormErrors, formErrors: string[]) => void | To see schema errors before they are distributed to the fields. | |
state? | FormState | null | State returned by the server. errors are distributed to fields by name, formErrors are shown above the form. See FormState. | |
loading? | boolean | FormLoadingMode | FormLoadingOptions | Shows the form as loading: true or "skeleton" turns fields into muted boxes, "disabled" disables them all, "overlay" puts a scrim over it that blocks touches. When skeleton ends, the defaultValues given at that moment are applied to the fields (if the user typed nothing). | |
submitLoading? | boolean | "disabled" | "overlay" | FormSubmitLoadingOptions | false` (only the {@link SubmitButton} shows loading) | Look of the form while submitting (while an async onValidSubmit runs): "disabled" (or true) disables the fields, "overlay" puts a scrim. If loading is given, it wins. |
errorDisplay? | ErrorDisplay | "message" | Error display style of all fields in the form. A field's own errorDisplay overrides it. See ErrorDisplay. |
disabled? | boolean | Disables all fields. | |
style? | StyleProp<ViewStyle> | Container style. | |
testID? | string | Test id. |