# Input **Category**: native **URL**: https://www.heroui.com/docs/native/components/input **Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/native/components/(forms)/input.mdx > A text input component with styled border and background for collecting user input. *** ## Import ```tsx import { Input } from 'heroui-native'; ``` ## Usage ### Basic Usage Input can be used standalone or within a TextField component. ```tsx import { Input } from 'heroui-native'; ; ``` ### Within TextField Input works seamlessly with TextField for complete form structure. ```tsx import { Input, Label, TextField } from 'heroui-native'; ; ``` ### With Validation Display error state when the input is invalid. ```tsx import { FieldError, Input, Label, TextField } from 'heroui-native'; Please enter a valid email ; ``` ### With Local Invalid State Override Override the context's invalid state for the input. ```tsx import { FieldError, Input, Label, TextField } from 'heroui-native'; Email format is incorrect ; ``` ### Disabled State Disable the input to prevent interaction. ```tsx import { Input, Label, TextField } from 'heroui-native'; ; ``` ### With Variant Use different variants to style the input based on context. ```tsx import { Input, Label, TextField } from 'heroui-native'; ``` ### Custom Styling Customize the input appearance using className. ```tsx import { Input, Label, TextField } from 'heroui-native'; ; ``` ### Inside a Bottom Sheet When rendering an Input inside a `BottomSheet`, use the `useBottomSheetAwareHandlers` hook to wire keyboard avoidance handlers. Pass the returned `onFocus` and `onBlur` to the Input. ```tsx import { Input, TextField, useBottomSheetAwareHandlers } from 'heroui-native'; const BottomSheetTextInput = () => { const { onFocus, onBlur } = useBottomSheetAwareHandlers(); return ( ); }; ``` ## Example ```tsx import { Ionicons } from '@expo/vector-icons'; import { Description, Input, Label, TextField } from 'heroui-native'; import { useState } from 'react'; import { Pressable, View } from 'react-native'; import { withUniwind } from 'uniwind'; const StyledIonicons = withUniwind(Ionicons); export const TextInputContent = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [isPasswordVisible, setIsPasswordVisible] = useState(false); return ( We'll never share your email with anyone else. setIsPasswordVisible(!isPasswordVisible)} > Password must be at least 6 characters ); }; ``` You can find more examples in the [GitHub repository](https://github.com/heroui-inc/heroui-native/blob/main/example/src/app/(home)/components/input.tsx). ## API Reference ### Input | prop | type | default | description | | ------------------------- | -------------------------- | --------------------- | ------------------------------------------------------------ | | isInvalid | `boolean` | `undefined` | Whether the input is in an invalid state (overrides context) | | variant | `'primary' \| 'secondary'` | `'primary'` | Variant style for the input | | className | `string` | - | Custom class name for the input | | selectionColorClassName | `string` | `"accent-accent"` | Custom className for the selection color | | placeholderColorClassName | `string` | `"field-placeholder"` | Custom className for the placeholder text color | | isBottomSheetAware | `boolean` | `true` | Whether the input automatically handles keyboard state when rendered inside a BottomSheet. Set to `false` to disable | | animation | `AnimationRoot` | `undefined` | Animation configuration for the input | | ...TextInputProps | `TextInputProps` | - | All standard React Native TextInput props are supported | > **Note**: When used within a TextField component, Input automatically consumes form state (isDisabled, isInvalid) from TextField via the form-item-state context.