Skip to main content

Input

The Input component in our library is a fundamental element used for capturing user input within forms or interactive interfaces. It allows users to enter and submit various types of data, such as text or numbers.

Usage

Basic usage

import {Input} from 'rn-inkpad';

const MyComponent = () => {
return <Input />;
};

Props

NameTypeDefaultDescription
autoCompleteautoCompleteSpecifies autocomplete hints for the system, so it can provide autofill.
borderColorstringBorder color.
borderRadiusnumberSet rounded corners.
iconstringInput icon.
iconColorstringInput icon color.
iconSizenumber15Input icon size.
keyboardTypeKeyboardTypeOptionsDetermines which keyboard to open, e.g.numeric.
labelstringInput label.
labelColorstringInput label color.
passwordbooleanfalsePassword mode adds an icon to show or hide the password.
placeholderstringInputInput placeholder.
placeholderColorstringInput placeholder color.
rightIconstringAdd an icon to the right, on said icon you can add a function.
rightIconColorstringRight icon color.
rightIconSizenumberRight icon size.
searchbooleanfalseActivate search mode to add a search icon.
styleStyleProp<ViewStyle>Custom styles for your input.
textColorstringInput value color.
textContentTypetextContentTypeGive the keyboard and the system information about the expected semantic meaning for the content that users enter.
textStyleStyleProp<TextStyle>Custom styles for your text input value.
type'filled' | 'bordered' | 'outlined'filledChoose input style.
valuestringThe value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided.
onChangeText(text: string) => voidCallback that is called when the text input's text changes. Changed text is passed as an argument to the callback handler.
onEndEditing() => voidCallback that is called when text input ends.
onPress() => voidCallback that is called when right icon is pressed.

Usage with props

import {View} from 'react-native';

import {Input} from 'rn-inkpad';

const MyComponent = () => {
return (
<View>
<Input
borderColor="#DB504A"
icon="airplane"
iconColor="#DB504A"
label="Search"
search
/>
<Input
borderColor="#21295C"
borderRadius={10}
icon="key"
iconColor="#21295C"
label="Password"
password
rightIconColor="#21295C"
type="bordered"
/>
<Input
borderColor="#576DEC"
borderRadius={10}
icon="at"
iconColor="#576DEC"
label="Email"
labelColor="#576DEC"
type="outlined"
/>
</View>
);
};

Example with props