Input

Input is a theme-aware text input component with support for titles, descriptions, helper text, validation states, and leading/trailing icons. It extends React Native's TextInput with additional UI chrome for building form-like interfaces.

The component automatically handles focus/blur styling, RTL icon swapping, and state-based visual feedback (error, success, default).

Usage

import { Input } from "stream-chat-react-native";

<Input
  variant="outline"
  title="Channel Name"
  description="Enter a name for your channel"
  placeholder="e.g. General"
  state="default"
/>;

With validation states:

<Input
  variant="outline"
  title="Email"
  state="error"
  errorMessage="Please enter a valid email address"
  value={email}
  onChangeText={setEmail}
/>

With icons:

<Input
  variant="outline"
  LeadingIcon={(props) => <SearchIcon {...props} />}
  TrailingIcon={(props) => <ClearIcon {...props} />}
  placeholder="Search..."
/>

Props

Input extends TextInputProps from React Native, so all standard text input props (like value, onChangeText, placeholder, keyboardType, etc.) are supported.

PropDescriptionType
variant (required)The visual variant of the input container. 'outline': input with a visible border, 'ghost': input with no border or background.'outline' | 'ghost'
titleLabel text displayed above the input.string
descriptionDescriptive text displayed below the title and above the input field.string
LeadingIconA render function for the icon displayed on the leading side (left in LTR, right in RTL) of the input.(props: IconProps) => ReactNode
TrailingIconA render function for the icon displayed on the trailing side (right in LTR, left in RTL) of the input.(props: IconProps) => ReactNode
stateThe current validation state of the input. Controls the visual styling and which helper message is displayed. Defaults to 'default'.'default' | 'error' | 'success'
helperTextWhether to show the helper text area below the input. When false, the error/success/info messages are hidden. Defaults to true.boolean
errorMessageMessage displayed below the input when state is 'error'.string
successMessageMessage displayed below the input when state is 'success'.string
infoTextMessage displayed below the input when state is 'default'.string
editableWhether the input is editable. Defaults to true.boolean
containerStyleAdditional style applied to the outermost container View wrapping the title, input, and helper text.StyleProp<ViewStyle>