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

PropTypeDefaultDescription
labelstring
helperTextstringGuidance below the field. Replaced by `error` when both are set.
errorstringPuts the field in its error state and announces the message.
requiredboolean
disabledbooleanfalse
sizeControlSize'md'
startReactNode
endReactNode
styleStyleProp<ViewStyle>The outer wrapper, including label and messages.
fieldStyleStyleProp<ViewStyle>The bordered field.
inputStyleStyleProp<TextStyle>The text inside the field.
nativebooleanRenders the real platform text field when `@leoanimesh/ferrule-native` is available. Needs no `start` or `end`.