Skip to content

Input

Live preview

Sign-in form with label, helper text, and error state.

Continue

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
labelstring—Input label
placeholderstring—Placeholder text
valuestring—Controlled value
onChangeText(text: string) => void—Text change callback
errorstring—Error message
helperTextstring—Hint text
leadingElementReactNode—Element at the start (e.g. icon)
trailingElementReactNode—Element at the end
size"sm" | "md" | "lg""md"Input size preset
disabledbooleanfalseDisable input

Heights align with Button for form rows:

SizeHeightUse case
sm36dpCompact filters, inline fields
md44dpDefault — matches Button md
lg52dpProminent checkout or auth fields

Corner radius uses radius.lg (same family as Button). Focus uses border color only — no layout shift.

  • Pair every field with a visible label (or floatingLabel + placeholder).
  • Use error for validation messages; helperText for non-error hints.
  • disabled reduces opacity and blocks editing — do not rely on color alone.

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" />;