Skip to main content

Input

A labeled text field with four visual variants (Input.Outline, Input.Filled, Input.Flushed, Input.Floating), plus shared label, helper text, and error states.

Variants​

Outline
Filled
Flushed
Floating
<Input.Outline label="Outline" placeholder="Type here" />
<Input.Filled label="Filled" placeholder="Type here" />
<Input.Flushed label="Flushed" placeholder="Type here" />
<Input.Floating label="Floating" />

Sizes​

Extra small
Small
Medium
Large
<Input.Outline size="xs" label="Extra small" placeholder="xs" />
<Input.Outline size="sm" label="Small" placeholder="sm" />
<Input.Outline size="md" label="Medium" placeholder="md" />
<Input.Outline size="lg" label="Large" placeholder="lg" />

Helper text, error, and disabled​

Email
We'll never share your email.
Username
Username is already taken.
Locked field
<Input.Outline label="Email" placeholder="you@example.com" helperText="We'll never share your email." />
<Input.Outline label="Username" placeholder="Username" isInvalid errorText="Username is already taken." />
<Input.Outline label="Locked field" placeholder="Can't edit" isDisabled />

Clearable​

Pass isClearable to show a clear ("✕") button whenever the field has a value; pressing it calls onChangeText with ''. Works across all four variants. The clear button's visibility tracks the controlled value prop, so pass value/onChangeText (not defaultValue) to get the auto show/hide behavior.

Search filter
const [value, setValue] = useState('react native');

<Input.Outline
label="Search filter"
value={value}
onChangeText={setValue}
isClearable
/>

Props​

All four variants (Input.Outline, Input.Filled, Input.Flushed, Input.Floating) share this prop set.

PropTypeDefaultDescription
size'xs' | 'sm' | 'md' | 'lg''md'Field height and font scale.
roundedbooleanFully rounded corners (not used by Input.Flushed).
labelstringField label rendered above the input.
helperTextstringHelper copy rendered below the input.
errorTextstringError copy rendered below the input; also shown when isInvalid is set.
isInvalidbooleanMarks the field as invalid, switching border/label color to the error token.
isDisabledbooleanDisables the field and dims it.
isReadOnlybooleanMarks the field as read-only.
startElementReactNodeContent rendered before the text input (e.g. an icon).
endElementReactNodeContent rendered after the text input (e.g. an icon). Replaced by the clear button while it's showing.
isClearablebooleanfalseShows a clear ("✕") button when value is non-empty; calls onChangeText('') on press.
clearIconTVajraIconComponentIcon used by the clear button. Defaults to a plain ✕ glyph.
refReact.Ref<TextInput>Ref forwarded to the underlying TextInput.

Also accepts the standard React Native TextInput props (value, defaultValue, onChangeText, placeholder, keyboardType, etc.) except bg, borderColor, rounded, p, px, py, which are reserved for the variant's own layout.

Input.Floating additionally accepts:

PropTypeDefaultDescription
variant'outline' | 'filled' | 'flushed''outline'Underlying container style the floating label animates on top of.