1.1.1 • Published 5 years ago

react-native-password-toggler v1.1.1

Weekly downloads
27
License
GPL
Repository
github
Last release
5 years ago

React Native Password Toggler

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.

Installation

Install via NPM

npm install react-native-password-toggler --save

Usage

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} 
            />
    )
  }
}

Props

CommandDescription
showShow or hide text input (Default: false)
inputStyleCustom style for the text input field (Example: {padding: 10})
iconStyleCustom style for the toggle icon (Example: {color: 'red'})

You can use default React Native's TextInput props also.

Contributing

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.

License

GPL