Input
Input, a React Native component for iOS, Android and web: A labelled text field with helper and error messages.
Usage
import { useState } from 'react';
import { Input } from './components/ui/input';
import { Stack } from './components/ui/stack';
export default function Example() {
const [email, setEmail] = useState('');
return (
<Stack gap={3} style={{ maxWidth: 360 }}>
<Input label="Email" helperText="We send the receipt here" value={email} onChangeText={setEmail} autoCapitalize="none" keyboardType="email-address" />
<Input label="Promo code" defaultValue="PEPPER" error="This code has expired" />
<Input label="Account" defaultValue="Locked" disabled />
</Stack>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | ||
helperText | string | Guidance below the field. Replaced by `error` when both are set. | |
error | string | Puts the field in its error state and announces the message. | |
required | boolean | ||
disabled | boolean | false | |
size | ControlSize | 'md' | |
start | ReactNode | ||
end | ReactNode | ||
style | StyleProp<ViewStyle> | The outer wrapper, including label and messages. | |
fieldStyle | StyleProp<ViewStyle> | The bordered field. | |
inputStyle | StyleProp<TextStyle> | The text inside the field. | |
native | boolean | Renders the real platform text field when `@leoanimesh/ferrule-native` is available. Needs no `start` or `end`. |