
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-password-strength
Advanced tools
A password strength indicator field using zxcvbn to calculate a password strength score.
Note: zxcvbn is a large library it's recommended you split the codebase to manage bundle size.
npm install --save react-password-strength
Note: react/react-dom is a peer dependency. You should be using this in a React project.
See the example repo
<ReactPasswordStrength
className="customClass"
style={{ display: 'none' }}
minLength={5}
minScore={2}
scoreWords={['weak', 'okay', 'good', 'strong', 'stronger']}
changeCallback={foo}
inputProps={{ name: "password_input", autoComplete: "off", className: "form-control" }}
/>
If using ES6 imports:
import ReactPasswordStrength from 'react-password-strength';
Using CommonJS require:
var ReactPasswordStrength = require('react-password-strength');
Using in a Universal JS App (server-side rendering):
react-password-strength/dist/universalreact-password-strength/dist/style.css.score, password, isValid)feedback (see docs for more properties)input element of the component. Things like name, id, etcclassName, onChange, ref, value
className will append to the existing classeschangeCallback will be called in componentDidMount.react-password-strength/dist/universal)All styling is applied with CSS classes to allow custom styling and overriding. Note that if you change the namespaceClassName prop the below classnames will be affected.
ReactPasswordStrength - namespace class and component wrapperis-strength-{0-4} - modifier class indicating password strengthReactPasswordStrength-input - password input fieldis-password-valid - modifier class indicating valid passwordis-password-invalid - modifier class indicating invalid password (only applies if password length > 0)ReactPasswordStrength-strength-bar - color bar indicating password strengthReactPasswordStrength-strength-desc - text indicating password strengthAccess through ref handle of ReactPasswordStrength.
clear - reset password field to initial stateFAQs
A password strength indicator field for use in React projects
The npm package react-password-strength receives a total of 4,065 weekly downloads. As such, react-password-strength popularity was classified as popular.
We found that react-password-strength demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.