Field

A label, a description and an error around a control, on its own or as a row of a List.

import { Field, FieldError, FieldSuccess, List } from "@plexui/react-native"

Examples

Overview

Success message

Group

Action rows

Spacing between groups

Other controls

Label

Platforms

iOS 26Android
Native componentForm cell (a text field in a grouped list)None: the Plex Android list rows and the outlined text field
On its ownThe label over the control, the help 4pt under itThe label floating in an Input's outlined field, the help 14sp under it
As a rowThe label at the start and the value at the end; or the label above the bare valueThe 16sp label beside the field; or the 13sp label above the bare 17sp value
Success message15/20 supporting text with a checkmark14/18 supporting text with a checkmark

API

Field

PropTypeDefaultDescription
labelReactNode—Label text for the field; it names the control
hideLabelbooleanfalseHides the label from view; it still names the control. On a row the value or placeholder starts at the row's edge
descriptionReactNode—Helper text under the control (on a row under its label); it describes the control. Pass FieldSuccess for a verified value; errors or an explicitly invalid control hide it
errorMessageReactNode—Error message under the control; marks the control invalid
labelActionReactNode—Content at the end of the label's line, such as a link that acts on the field
requiredbooleanfalseShows a required asterisk after the label (visual only)
orientation"vertical" | "horizontal""horizontal" on a row with a visible label, else "vertical"Layout direction of label and control
rowbooleanfalseOne line of a List, as the web's row of a FieldGroup
fillbooleanfalseOn a row, the control takes the rest of the line after the label
iconReactNode—On a row, a symbol before the label
actionReactNode—On a row, a control at the end of the row after the row's own control
disabledboolean—The field is unavailable as a whole: its label dims with the control (the web's data-disabled)
childrenReactElement | (control: FieldControlProps) => ReactNode—The control; it receives accessibilityLabel, the description's hint (aria-describedby on the web) and invalid. A function receives them to place itself
styleStyleProp<ViewStyle>—Style of the root (on its own)
testIDstring—Test id of the root

List (the web's FieldGroup)

List takes these props for forms, in addition to its own (see List):

PropTypeDefaultDescription
headerReactNode—Heading over the rows; the web's title
headerProminence"standard" | "increased""standard"How much the header stands out: on iOS the prominent list header, 20pt Semibold in the primary label
actionReactNode—Content at the end of the header; a ghost Button is the header's text action
footerReactNode—Content under the rows, such as a note
columnsbooleanfalseEvery value starts at one column, 40% into the row

FieldError

PropTypeDefaultDescription
childrenReactNode—The error message; announced when it appears
iconbooleantrueThe exclamation mark before the message (iOS; Android draws none)
nativeIDstring—Id that a control's description can point at
styleStyleProp<ViewStyle>—Style of the root

FieldSuccess

PropTypeDefaultDescription
childrenReactNode—The success message; it does not announce itself as a live region
iconbooleantrueShows a circled checkmark before the message on iOS and Android
nativeIDstring—Id that a control's description can point at
styleStyleProp<ViewStyle>—Style of the root
testIDstring—Test id of the root

A success message can also stand under the rows in a List's footer. Pass FieldSuccess directly: the List keeps its footer spacing and FieldSuccess provides the message's type and icon on both platforms. A footer is not linked to an individual field automatically. Give the status a stable nativeID from React's useId, then pass that id as the Input's aria-describedby and the status text as its accessibilityHint.

When an error appears or the control becomes invalid, hide the success footer and clear its id and hint together. The Field then links its own error message to the control:

import { useId } from "react"
import { Field, FieldSuccess, Input, List } from "@plexui/react-native"

function VerifiedEmail({ errorMessage, invalid = false }: { errorMessage?: string; invalid?: boolean }) {
  const statusId = useId()
  const status = !errorMessage && !invalid ? "Email verified" : undefined

  return (
    <List footer={status ? <FieldSuccess nativeID={statusId}>{status}</FieldSuccess> : undefined}>
      <Field row hideLabel label="Email" errorMessage={errorMessage}>
        <Input
          value="ada@plexui.com"
          readOnly
          inputMode="email"
          invalid={invalid}
          aria-describedby={status ? statusId : undefined}
          accessibilityHint={status}
        />
      </Field>
    </List>
  )
}

Set these tokens through ThemeProvider brand.tokens to customize the success message:

TokenDefaultPurpose
--field-success-color--color-text-successText and checkmark color
--field-success-font-size15 on iOS, 14 on AndroidSupporting text size
--field-success-line-height20 on iOS, 18 on AndroidSupporting text line height
--field-success-icon-size16Checkmark size
--field-success-icon-gap4Space between the checkmark and message