This is a NativeBase component built on top of React Native's <TextInput>.
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, such as auto-correction, auto-capitalization, placeholder text, and different keyboard types, such as a numeric keypad. Provides a number of attributes that follows styling and interaction guidelines for each platform, so that they are intuitive for users to interact with.
Contents:
- Regular Textbox
- Underlined Textbox
- Rounded Textbox
- Icon Textbox
- Success Input Textbox
- Error Input Textbox
- Disabled Textbox
General Syntax
import React, { Component } from 'react';
import { Container, Content, InputGroup, Input } from 'native-base';
export default class InputGroupExample extends Component {
render() {
return (
<Container>
<Content>
<InputGroup>
<Input />
</InputGroup>
</Content>
</Container>
);
}
}- NativeBase extends React Native's
<TextInput/>by adding several attributes and props to<Input />. - NativeBase defines textbox for you, by just defining
<Input />in your app. - Supports custom styles on both iOS and Android devices.
- InputGroup component renders elements such as: Text, Input, Icon.
- The props of
<TextInput>are smoothly applicable to<Input>. - InputGroup also takes in props value.
- Replacing Component for InputGroup: React Native
<View> - Replacing Component for Input: React Native
<TextInput>
Configuration
| Property | Default | Option | Description |
|---|---|---|---|
| placeholder | - | - | The string that will be rendered before text input has been entered. Optional user-defined placeholder for textbox. |
| regular | false | true false | Wraps the textbox with sharp border. |
| underline | false | true false | textbox with only bottom border. |
| rounded | false | true false | Wraps the textbox with rounded border. |
| secureTextEntry | false | true false |
If true, the text input obscures the text entered so that sensitive text like passwords stay secure. This prop can be passed to <Input>. |
| success | - | - | The border color of textbox for valid input. |
| error | - | - | The border color of textbox for invalid input. |
| disabled | - | - | Disables inputting data. |

