React Native · APIs and utilities
Field
Common props of form fields (the same names as the fields on web).
2 exports
FieldProps
interfaceCommon props of form fields (the same names as the fields on web).
| Name | Type | Default | Description |
|---|---|---|---|
label? | ReactNode | Label. | |
description? | ReactNode | Description below the label. | |
error? | ReactNode | Error message; when given the field is drawn as invalid and the message shows below. | |
required? | boolean | Required field: a * is added next to the label. | |
disabled? | boolean | Disabled. | |
name? | string | Its name in the form (name, address.city, items[0].name). When given inside a Form, the value, error, required and disabled state come from the form. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" below, "reserve" below with its space reserved up front (nothing shifts), "icon" / "icon-end" an icon to the left/right of the label with the message in a tooltip on tap. Defaults to the form's. |
FieldVariant
typeField appearance (the same as FieldVariant on web).
outline: a bordered box (default).filled: a box with a muted background and no border.underline: only a bottom line.ghost: borderless until focused.