npm.io
1.1.1 • Published 7 years ago

react-native-password-toggler

Licence
GPL
Version
1.1.1
Deps
2
Size
50 kB
Vulns
0
Weekly
0

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

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.

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

Keywords