Input
A single-line text field with adornments and a clear button, plus TextField with a label.
import { Input, TextField } from "@plexui/react-native"Examples
Overview
TextField is an Input with a label, a description under it and an errorMessage that takes the description's place and marks the field invalid; required adds an asterisk to the label. On iOS the label stands over the field (15/20 medium) and the help 4pt under it; on Android the label floats onto the outline, or to the top of a filled field, when the field has focus or a value, in the accent while it has focus (its lighter text at night), and the help is 14sp text in the secondary gray under the field.
Password with visibility toggle
SSN input
Birthday input
Birthday with validation
With button
Platforms
| iOS 26 | Android | |
|---|---|---|
| Native component | Text field | Text field (filled or outlined) |
| Look | A 44pt field in 17pt type, its border darkening on focus | A 50dp field in 17sp type, its outline thickening in the accent on focus |
| In a List row | The row's value: no frame, the text at the row's end, the error a line under the row | A field at the row's end, the error under the label |
API
Input
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "outline" | "soft" | "ghost" | "outline" | Fill style; ghost has no frame. On Android outline is the outlined field, soft a field filled with the text color at 5% (with a startAdornment and no label, the 40dp search field) |
size | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "md" | Step of the control scale. On iOS every step is the 44pt phone control and the size changes the radius, gutter and type; Android fields are 50dp, 56 with a label |
value | string | — | Controlled text |
defaultValue | string | — | Initial text (uncontrolled) |
onChangeText | (text: string) => void | — | Called with the text on every change |
placeholder | string | — | Shown while the field is empty |
invalid | boolean | false | Draws the field in the error color |
disabled | boolean | false | Dims the field and takes no input (TextInput's editable is not used) |
readOnly | boolean | false | Keeps the value and hides the clear button |
onClear | () => void | — | Shows a clear button while the field has a value: on iOS while it is edited, or while a search field has text, and never for a value at a row's end. A press clears the text (onChangeText receives an empty string), then calls it |
startAdornment | ReactNode | — | An icon or element before the text |
endAdornment | ReactNode | — | An icon or element after the text |
pill | boolean | false | A capsule. On iOS a 3xl capsule is the text field of a step (Health, Mail, Apple Account): 52pt, the height of the action under it, its text 20 in |
style | StyleProp<ViewStyle> | — | Style of the field's box |
ref | Ref<ComponentRef<typeof TextInput>> | — | The text input itself, for focus(), blur() and clear() |
testID | string | — | Test id |
Every other prop of React Native's TextInput passes through to the text input (keyboardType, inputMode, secureTextEntry, selectTextOnFocus, autoCapitalize, autoComplete, maxLength, onFocus, onBlur and so on).
Input.AdornmentButton
A button in startAdornment or endAdornment, as the web's Input.AdornmentButton (also exported as InputAdornmentButton). Every other prop of Pressable passes through.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The icon: it takes the button's color and size (19pt at an iOS row's end, 20 in a field, 24dp on Android) |
accessibilityLabel | string | — | The button's name for screen readers (required) |
selected | boolean | — | A toggle's state, read as selected |
onPress | () => void | — | Called on a press |
disabled | boolean | — | Dims the button and takes no press |
TextField
TextField takes every prop of Input, plus:
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | — | The field's name (required): over the field on iOS, floating inside it on Android |
description | ReactNode | — | Help under the field |
errorMessage | ReactNode | — | Shown under the field in place of the description, and marks it invalid |
required | boolean | — | Adds an asterisk to the label and marks the field required |
labelAction | ReactNode | — | Content at the end of the label's line on iOS, of the help's line on Android (where the label floats) |
counter | boolean | string | false | Shows the count of characters against maxLength (3/15): Material's counter at the end of the help's line on Android, at the end of the label's line on iOS. A string is a count of its own in that place (chosen tags, "3/10") |