Skip to main content
Version: 1.x

Text Input

The Text Input, a text input with label, count, helper text, left and right icons, and animations for the label and input box.

Import

import { TextInput } from '@tra-tech/react-native-kitra';

Usage

import { TextInput, Icon } from '@tra-tech/react-native-kitra';
import { View } from 'react-native';

const App = () => (
<View style={{ justifyContent: 'center', flex: 1 }}>
<TextInput
label="E-mail"
size="large"
left={<Icon type="ant-design" name="check" size={20} />}
right={<Icon type="ant-design" name="apple1" size={20} />}
count
defaultValue="Default Value"
maxLength={20}
helperText="Normal"
errorMessage="ERROR"
/>
</View>
);

export default App;

Props

Prop nameTypeRequiredDescription
size'small' | 'medium' | 'large'NoThe size of the text input. Default Value: 'medium'
iconPosition'left' | 'right' NoLocation of the icon.
labelColor{focus:string, default:string}NoLabel color for focus and unfocus status
helperTextstringNoText of helper text.
helperTextStyleStyleProp<TextStyle>NoAdditional styles to apply to the helper text.
variant'filled' | 'outlined'NoVariant of the TextInput. Default value: 'filled' ,
containerStyleStyleProp<TextStyle>NoStyle of outter input container.
inputContainerStyleStyleProp<TextStyle>NoStyle of inner input container.
labelContainerStyleStyleProp<TextStyle>NoStyle of label container.
countbooleanNoShows the number of text input characters. Default value: false.
labelstringNoThe text to use for the floating label.
labelStyleStyleProp<TextStyle>NoAdditional styles to apply to the label text.
editablebooleanNoIf false, text is not editable. Default value: true.
inputStyleStyleProp<ViewStyle>NoAdditional styles to apply to the text input.
errorMessagestringNoError message.
errorboolean NoIf error is true error message is shown.
leftReact.ReactNodeNoUsed to add a react node to the left of the text input.
rightReact.ReactNodeNoUsed to add a react node to the right of the text input.
...TextInputPropsTextInputPropsNoAny additional props to be passed TextInput component.
themeUITheme NoThe UI theme to use for the component.
typographyUITypography NoThe UI typography to use for the component.