Skip to content

Input

The Input component provides a styled text input with support for labels, error messages, helper text, and icons.

import { Input } from '@truongdq01/ui';
import { Mail } from 'lucide-react-native';
<Input
label="Email"
placeholder="you@example.com"
leadingElement={<Mail />}
onChangeText={(text) => console.log(text)}
/>;
PropTypeDefaultDescription
labelstringInput label
placeholderstringPlaceholder text
valuestringControlled value
onChangeText(text: string) => voidText change callback
errorstringError message
helperTextstringHint text
leadingElementReactNodeElement at the start (e.g. icon)
trailingElementReactNodeElement at the end
size"sm" | "md" | "lg""md"Input size preset
disabledbooleanfalseDisable input

Inputs come in three standardized heights:

  • Small: 32px
  • Medium: 40px
  • Large: 48px

Elements passed to leadingElement or trailingElement are automatically styled via useIconStyle to match the input’s size and color context.

import { Search } from 'lucide-react-native';
<Input placeholder="Search..." leadingElement={<Search />} size="sm" />;