npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-password-strength-variant-indicator

v1.1.0

Published

Password strength check indicator for react

Downloads

11

Readme

React Password Strength Indicator

A password strength checker with various indicator options using zxcvbn library.

Demo App

Try it live

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development.

Prerequisites

react/react-dom is a peer dependency. You should be using this in a React project.

Installing

Add password strength indicator to your project by executing

npm install react-password-strength-variant-indicator

Usage

Here's an example of basic usage:

import React, { Component } from 'react';
import StrengthCheck from "react-password-strength-variant-indicator";

class MyApp extends Component {
  state = {
    inputprops: { inputclass: "form-control", autocomplete: "off", tabIndex: 0 },
    value: ''
  }

  changeCallBackHandler = value => {
   this.setState({ value: value })
  };
  
  render() {
    return (
      <div>
        <StrengthCheck
        changecallback={val => {
          changeCallBackHandler(val);
        }}
        validscore="1"
        inputprops={this.state.inputprops}
        variant="circle"
      />
      </div>
    );
  }
}

User guide

Props

|Prop name|Description|Default value|Example values| |----|----|----|----| |minLength|The minimum length of password to be typed.|5|minLength=6| |validscore|The minimum valid score the password should have(The score value ranges from 0 to 4 depends on strength and complexity)|2|validscore=3| |strength|The strength of the password based on the score | { 0: "Worst", 1: "Bad",2: "Weak",3: "Good",4: "Strong"}|strength={0: "Weak",1: "Weak",2: "moderate",3: "Good",4: "Strong"}| |className|The className which get added to the component|No|className=form| |inputprops|Object which accepts all the parameters that will be used in input tag|No|inputprops={{inputclass: 'form-control-input',autocomplete: 'off'tabIndex=-1,}| |variant|This gives different types of variant options that can be choosed for strength display|linear-stripped|variant=line| |changecallback|A callback function which gets triggered onChange which gives the input value in the format {value: typedValue,isValid: boolean,score: score}.isValid is a boolean which depends on the input length and score.score value ranges from 0 to 4 which depends on password strength and complexity.value gives the inputvalue in the field|No|changecallback={val => {changeCallBackHandler(val);}}|

variants

|variant name|Example| |----|----| |variant=linear|| |variant=linear-stripped|| |variant=discontinuous|| |variant=discontinuous-stripped|| |variant=circle|| |variant=line||

License

This project is licensed under the MIT License - see the LICENSE.md file for details