1.0.17 • Published 5 years ago

awesome-react-password-strength-meter v1.0.17

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

awesome-react-password-strength-meter

awesome-react-password-strength-meter

Demo

Demo

import React, { Fragment } from "react";
import PasswordStrength from "./passwordStrength";

const StrengthLabel = () => <b>Strength</b>;
export default class extends React.Component {
  state = {
    password: "",
  };

  handlePasswordChange = e => {
    e.persist();
    this.setState({ password: e.target.value });
  };

  render() {
    return (
      <Fragment>
        <div
          style={{
            border: "1px solid red",
            textAlign: "left",
            diplay: "block",
            width: "500px"
          }}
        >
          <PasswordStrength
            name="password-strength"
            value={this.state.password}
            minLength={3}
            errorBorder={false}
            myStyles={{
              height: "8px",
              marginTop: "5px",
              display: "inline-block"
            }}
            strengthLabel={{
              text: `%strength%`,
              label: StrengthLabel, // optional either string or component
              visible: true,
              style: {
                display: "inline",
                paddingRight: "10px",
                width: "50%"
              }
            }}
            colors={{
              poor: {
                color: "red",
                label: "Very weak"
              },
              weak: {
                color: "red",
                label: "Very weak"
              },
              good: {
                color: "orange",
                label: "Good"
              },
              strong: {
                color: "lightgreen",
                label: "Strong"
              },
              veryStrong: {
                color: "#4cbac0",
                label: "Awesome Very strong"
              }
            }}
          >
            <input
              name="password"
              onChange={this.handlePasswordChange}
              value={this.state.password}
            />
          </PasswordStrength>
        </div>
      </Fragment>
    );
  }
}
1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.9

5 years ago