Mobile › Inputs
TextField
A labelled text input with a hint and an error message. The label always stays visible.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { TextField } from "plankui-mobile";
const [email, setEmail] = useState("");
<TextField
label="Email"
placeholder="[email protected]"
keyboardType="email-address"
autoCapitalize="none"
value={email}
onChangeText={setEmail}
hint="We only use it to sign you in."
error={invalid ? "That doesn't look like an email address." : undefined}
/>iOS and Android
iOS: A filled rounded field. Text stays at 16 pt or more so iOS Safari never zooms in.
Android: A Material 3 outlined field; the outline and label turn accent on focus.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | Always visible above the field. | |
| hint | string | – | Help text under the field. |
| error | string | – | Shown instead of the hint and read out by screen readers. |
| inputStyle | StyleProp<TextStyle> | – | Style for the input itself. |
| ref | Ref<TextInput> | – | To focus the field from code. |
| ...TextInputProps | TextInputProps | – | Any React Native TextInput prop: value, onChangeText, keyboardType, secureTextEntry... |