0.1.3 • Published 4 years ago

react-type-password v0.1.3

Weekly downloads
16
License
-
Repository
-
Last release
4 years ago

React Type Password

Controlled password input that can be of text type.

Installation

$ npm install react-type-password

Usage

import Password from 'react-type-password';
<Password
  id="password"
  type="text"
  mask='?'
  className="form-control"
  name="password"
  placeholder="Enter password"
  style={{backgroundColor:"transparent"}}
  disabled={false}
  value={this.state.password}
  onChange={this.handleChange}
/>

Options

OptionTypeDescription
typestringDefines the type of the input. Options: password, text. Default: text.
valuestringRequired. The current value of the password/text field.
idstringThe HTML id attribute.
maskcharThe character used to hide the inpupt. Default:
namestringThe HTML name attribute.
classNamestringA space-separated list of HTML class attributes.
placeholderstringThe HTML placeholder attribute.
styleobjectInline CSS styles to be applied.
disabledbooleanThe HTML disabled attribute.
onChangefunctionRequired. A callback function to be invoked when the value of the field changes. Receives an argument containing the new text value.

License

MIT