1.0.27 • Published 3 years ago
@iamkoushik/kp-textinput v1.0.27
KPTextInput
A simple react-native implementation of TextInput.
Features
- Can be used as a Custom TextInput
- Custom Styling
- Supports Password show/hide
- Supports Label Text as TextInput Label
Getting started
Install the library using either Yarn:
npm i @iamkoushik/kp-textinput
or yarn:
js
yarn add @iamkoushik/kp-textinput
Usage
import KPTextInput from '@iamkoushik/kp-textinput';
const App = () => {
const [value, setValue] = useState('');
return (
<View>
<KPTextInput
textboxStyle={{ height: 48, fontSize: 14, marginTop: 12 }}
placeholder="Email Address"
textboxvalue={value}
type={"email-address"}
isPassword={false}
onChangeText={(value) => setValue(value)}
keyboardType={"default"}
labelplaceholder="Email Address"
/>
<KPTextInput
textboxStyle={{ height: 48, fontSize: 14, marginTop: 12 }}
placeholder="Email Address"
textboxvalue={value}
type={"email-address"}
isPassword={false}
onChangeText={(value) => setValue(value)}
keyboardType={"default"}
editable={false} // Can't edit now
isShowLabel={false} // Not to show the label text
/>
<KPTextInput
labelBackgroundColor="red"
customlabelStyle={{ borderRadius: 3, padding: 2 }}
labelTextColor="#fff"
textboxStyle={{ height: 48, fontSize: 15, marginTop: 12, fontWeight: 'bold' }}
placeholder="Password"
textboxvalue={value}
type={"email-address"}
isPassword={true} // To show the TextInput as Password field
onChangeText={(value) => setValue(value)}
keyboardType={"default"}
showPassword={true}
labelplaceholder="Password"
/>
</View>
)
}
Properties
Name | Type | Description | Default |
---|---|---|---|
textboxStyle | Object | Custom styling | {} |
boxvalue | String | value of the textinput | '' |
isPassword | Boolean | To show as Password | false |
isShowLabel | Boolean | To show the label | false |
bashowPassword | Boolean | To show the eye-icon | false |
editable | Boolean | To restrict the edit mode | false |
onChangeText | Function (value: String) | Function called when user start typing | null |
labelBackgroundColor | String | Background color of the Label text | "#fff" |
labelTextColor | String | Text color of the Label | "#000" |
Contributing
If you'd like to see something added or changed to this module please open a new GitHub issue. Pull requests are always welcome.
License
© Koushik Paul
1.0.27
3 years ago
1.0.26
3 years ago
1.0.25
3 years ago
1.0.24
3 years ago
1.0.23
3 years ago
1.0.22
3 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago