1.0.10 • Published 10 years ago

react-custom-password-mask v1.0.10

Weekly downloads
2
License
ISC
Repository
-
Last release
10 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

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago