1.0.10 • Published 8 years ago

react-custom-password-mask v1.0.10

Weekly downloads
2
License
ISC
Repository
-
Last release
8 years ago

React Custom Password Mask

The idea is to make it a drop in replacement for <input type="password"/> while being able to use any masking char (instead of the default bullet.)

Install

npm install react-custom-password-mask --save

Usage

import React from 'react';
import serialize from 'form-serialize';
import CustomMaskedPassword from 'react-custom-password-mask';

export default React.createClass({

  submitHandler(event) {
    event.preventDefault();

    // Using ref: secret
    console.log("Using ref:", this.refs.pswd.value);

    // From form: password=secret
    console.log("From form:", serialize(this.refs.form));
  },

  render() {
    return (
      <form ref="form" onSubmit={this.submitHandler}>
        <CustomMaskedPassword ref="pswd" name="password" mask="X"/>
        <button>Submit</button>
      </form>
    );
  }

}); 

You can also use multibyte chars:

<MaskInput mask="💩"/>
1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago