Command palette

@yasinsensoy/native

React Native · APIs and utilities

Field

Common props of form fields (the same names as the fields on web).

2 exports

FieldProps

interface

Common props of form fields (the same names as the fields on web).

NameTypeDefaultDescription
label?ReactNodeLabel.
description?ReactNodeDescription below the label.
error?ReactNodeError message; when given the field is drawn as invalid and the message shows below.
required?booleanRequired field: a * is added next to the label.
disabled?booleanDisabled.
name?stringIts 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.

Field 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.
type FieldVariant = "outline" | "filled" | "underline" | "ghost"