Skip to main content

Input

Input is a themed text input with support for labels, captions, status colors, size variants, and accessory slots for icons.

Import

import { Input } from '@ui-kitten/components';

Basic Usage

import React, { useState } from 'react';
import { Layout, Input, Icon } from '@ui-kitten/components';

const InputExample = () => {
const [value, setValue] = useState('');

return (
<Layout style={{ flex: 1, padding: 16, gap: 8 }}>
<Input
label="Username"
placeholder="Enter your username"
value={value}
onChangeText={setValue}
/>

<Input
label="Password"
caption="Must be at least 8 characters"
placeholder="Enter your password"
secureTextEntry
accessoryRight={(props) => <Icon {...props} name="eye-off" />}
/>

<Input
status="danger"
label="Email"
caption="Invalid email address"
placeholder="Email"
/>
</Layout>
);
};

Props

PropertyTypeDefaultDescription
status'basic' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'control''basic'Semantic color applied to the input border and label.
size'small' | 'medium' | 'large''medium'Size of the input.
labelReactText | (props) => ReactElementundefinedLabel displayed above the input.
captionReactText | (props) => ReactElementundefinedCaption displayed below the input (e.g., validation message).
placeholderstringundefinedPlaceholder text displayed when the input is empty.
accessoryLeft(props) => ReactElementundefinedRender function for the left accessory (e.g., icon).
accessoryRight(props) => ReactElementundefinedRender function for the right accessory (e.g., icon).
disabledbooleanfalseWhether the input is disabled.
textStyleTextStyleundefinedStyle applied to the input text.

Input also accepts all standard React Native TextInput props.

Storybook

Live examples coming soon via Storybook.