Skip to content

A React component that displays the password strength bar

License

Notifications You must be signed in to change notification settings

ento-io/react-password-strength-bar

This branch is up to date with lannex/react-password-strength-bar:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6371331 · Jun 5, 2022
Oct 5, 2021
Jun 5, 2022
Oct 5, 2021
May 17, 2019
Oct 5, 2021
Aug 7, 2019
May 17, 2019
Jan 29, 2020
May 17, 2019
May 16, 2019
Oct 5, 2021
May 17, 2019
Jun 5, 2022
Mar 6, 2020
Mar 6, 2020
May 17, 2019
Oct 5, 2021

Repository files navigation

react-password-strength-bar

A React component that displays the password strength bar

NPM

Version Build Coverage Status code style: prettier License

Gif

Note

  • This package is based on zxcvbn. zxcvbn is a powerful library, but its size is very large. I recommend you use this package by Code-Splitting.
  • The input tag is not included. If you want to include the input tag, use the mmw/react-password-strength package.

Install

$ npm install react-password-strength-bar
$ yarn add react-password-strength-bar

Usage

import PasswordStrengthBar from 'react-password-strength-bar';

const { password } = this.state;
<PasswordStrengthBar password={password} />

Props

className: string

  • isRequired: false
  • default: undefined

style: object

  • isRequired: false
  • default: undefined

scoreWordClassName: string

  • isRequired: false
  • default: undefined

scoreWordStyle: object

  • isRequired: false
  • default: undefined

password: string

  • isRequired: true
  • default: ''

userInputs: string[]

  • isRequired: false
  • default: []

barColors: string[]

  • isRequired: false
  • default: ['#ddd', '#ef4836', '#f6b44d', '#2b90ef', '#25c281']

scoreWords: ReactNode[]

  • isRequired: false
  • default: ['weak', 'weak', 'okay', 'good', 'strong']

minLength: number

  • isRequired: false
  • default: 4

shortScoreWord: ReactNode

  • isRequired: false
  • default: 'too short'

onChangeScore: (score, feedback) => void

  • isRequired: false
  • default: undefined

Browser support

Tested with modern browsers.

License

the MIT license.

About

A React component that displays the password strength bar

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 81.1%
  • JavaScript 18.9%