Tac UIv1.1.2

Input

A single-line text input field with support for labels, helper text, error states, left and right icon slots, and disabled mode. Built on top of React Native's TextInput.

Import

tsx
import { Input } from '@tac-ui/native';

Playground

Interactively configure the Input props below.

tsx
<Input placeholder="Enter text..." />

Sizes

Three size options control the height and font size of the input.

tsx
<Input size="sm" placeholder="Small" />
<Input size="md" placeholder="Medium (default)" />
<Input size="lg" placeholder="Large" />

Default

The base input renders a full-width styled text field with smooth border transitions on hover and focus.

tsx
<Input placeholder="Enter text..." />

With Icons

Use leftIcon or rightIcon to render an icon inside the input. The icon slot accepts any React node.

tsx
import { Search } from '@tac-ui/icon-native';

<Input placeholder="Search..." leftIcon={<Search size={16} />} />

With Label and Helper

Pass label to render a text label above the field. helperText appears below when there is no active error.

Email
We'll never share your email.
tsx
<Input label="Email" placeholder="[email protected]" helperText="We'll never share your email." />

Error State

Set error to apply destructive border styling and pass errorMessage to display an error description below the field.

Username
Username is already taken.
tsx
<Input label="Username" placeholder="username" error errorMessage="Username is already taken." />

Disabled

Set editable to false to disable the input. It renders at reduced opacity and ignores all user interaction.

tsx
<Input placeholder="Disabled input" editable={false} />

API Reference

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"Controls the height and font size of the input.
labelstring-Label displayed above the input.
helperTextstring-Helper text displayed below the input when there is no error.
errorbooleanfalseApplies error styling when true.
errorMessagestring-Error message displayed when error is true.
leftIconReact.ReactNode-Icon rendered on the left side of the input.
rightIconReact.ReactNode-Icon rendered on the right side of the input.
editablebooleantrueWhen false, disables the input and reduces its opacity.
containerStyleViewStyle-Additional styles applied to the outer container View.
...TextInputProps--All standard React Native TextInput props are supported.