1.0.0-1 • Published 4 years ago

react-passwords-checklist v1.0.0-1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-passwords-checklist

A React package that shows a checklist of rules a user's password should fulfil. Very customizable!

NPM JavaScript Style Guide

Example

Checklist Demo

Install

npm install --save react-passwords-checklist

Usage

import React, { Component } from 'react'

import PasswordChecklist from 'react-passwords-checklist'

const App = () => {
  return <PasswordChecklist password={password} />
}

Props

PropsDescriptionTypeDefault valueoptions
passwordPassword for testingString--
minLengthMinimum password lengthNumber8-
conditionsArray of custom conditions you want to check for on passwordArray'length', 'number','specialChar', 'uppercase', 'lowercase''length', 'number','specialChar', 'uppercase', 'lowercase'
checkIconIcon to indicate that the test passedString''Desired icon
failIconIcon to indicate that the test failedString''Desired icon
checkIconColorColor of checkIconString'green'Desired color in rgba, hex, etc.
failIconColor of failIconString'red'Desired color in rgba, hex, etc.
fontSizeFont size of checklistString'1rem'Desired font-size in px, rem, etc
classNameclassName for componentString-Desired className

Example Usage with various props

import React from 'react'
import PasswordChecklist from 'react-passwords-checklist'

const App = () => {
  const password = '123abcABc@'
  return (
    <PasswordChecklist
      password={password}
      minLength={3}
      conditions={['length', 'number', 'specialChar', 'uppercase', 'lowercase']}
      checkIconColor={'green'}
      failIconColor={'red'}
      fontSize='1rem'
    />
  )
}

License

MIT © temmietope