A Simple password toggler (Hide/Show) component for React Native's TextInput field
This component allows you Toggle the password fields for your React Native forms.
Install via NPM
npm install react-native-password-toggler --save
import RNPasswordToggler from 'react-native-password-toggler';
export default class App extends Component {
state = {
password: '',
show: false, //optional
}
render() {
return (
<RNPasswordToggler
onChangeText={(value) => this.setState({password: value})}
show={this.state.show}
/>
)
}
}
Command | Description |
---|---|
show |
Show or hide text input (Default: false) |
inputStyle |
Custom style for the text input field (Example: {padding: 10}) |
iconStyle |
Custom style for the toggle icon (Example: {color: 'red'}) |
You can use default React Native's TextInput props also.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.