Input | NativeBase | Universal Components for React and React Native

Search
K
Hire us
Resources
Data Display
Typography
Disclosure
Media and Icons
Others
If you are starting a new project, please try gluestack-ui for better performance and new design.
Input
Show Code
Playground
The Input component allows a user to provide input in a text field.
Examples
Basic
Playground
Input Sizes
Playground
Input Variants
Playground
Input Addons
Playground
Input Elements
Playground
Password Input
Playground
Controlled Input
Playground
Form Controlled
Playground
Props
Input
isInvalid
If true, the input will indicate an error.
Type: any
variant
The variant of the input style to use.
Type: any
Default: 'outline'
isDisabled
If true, the input will be disabled.
Type: any
isHovered
If true, the input will be hovered.
Type: any
isFocused
If true, the input will be focused.
Type: any
size
The size of the input.
Type: any
Default: 'md'
isRequired
This will set aria-required="true" on web when passed in formcontrol.
Type: any
isReadOnly
If true, prevents the value of the input from being edited.
Type: any
isFullWidth
If true, the input element will span the full width of its parent
Type: any
InputLeftElement
If given, adds the provided element to the left of the input.
Type: any
leftElement
If given, adds the provided element to the left of the input.
Type: any
InputRightElement
If given, adds the provided element to the right of the input.
Type: any
rightElement
If given, adds the provided element to the right of the input.
Type: any
type
Using the type password, user can mask the input.
Type: any
wrapperRef
Ref to be passed to Icon's wrapper Box
Type: any
_hover
Passed props will be applied on hovered state.
Type: any
_focus
Passed props will be applied on focused state.
Type: any
_disabled
Passed props will be applied on disabled state.
Type: any
_readOnly
Passed props will be applied on readOnly state.
Type: any
_invalid
Passed props will be applied on invalid state.
Type: any
Input.Group
variant
The variant of the input style to use.
Type: string
Default: 'outline'
size
The size of the input.
Type: ResponsiveValue<number | "full" | "sm" | "6" | "2xs" | "8" | "xs" | "12" | "md" | "16" | "xl" | "24" | "32" | "2" | "0.5" | "4" | "3" | "lg" | "1" | "2xl" | "10" | "20" | "64" | "0" | "px" | "container" | ... 28 more ... | (string & {})>
Default: 'md'
Styling
NativeBase ships with a default theme for each component. Check out the default theme of the input.
Info: We can easily extend the input component theme using extendTheme function as described in the documentation .
Nativebase logo
MadeWithNativeBase
Gluestack logo
gluestack-ui