{"id":14384531,"url":"https://github.com/mmw/react-password-strength","last_synced_at":"2025-08-23T17:32:38.617Z","repository":{"id":57118184,"uuid":"64491907","full_name":"mmw/react-password-strength","owner":"mmw","description":"A password strength indicator field for use in React projects","archived":true,"fork":false,"pushed_at":"2019-03-27T09:47:05.000Z","size":1238,"stargazers_count":184,"open_issues_count":7,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-29T08:41:57.559Z","etag":null,"topics":["password","password-strength","react","zxcvbn"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-29T15:43:38.000Z","updated_at":"2024-10-24T14:05:02.000Z","dependencies_parsed_at":"2022-08-23T06:31:37.678Z","dependency_job_id":null,"html_url":"https://github.com/mmw/react-password-strength","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmw%2Freact-password-strength","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmw%2Freact-password-strength/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmw%2Freact-password-strength/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmw%2Freact-password-strength/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmw","download_url":"https://codeload.github.com/mmw/react-password-strength/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716547,"owners_count":18269786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["password","password-strength","react","zxcvbn"],"created_at":"2024-08-28T18:01:27.278Z","updated_at":"2024-12-21T12:30:41.023Z","avatar_url":"https://github.com/mmw.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# React Password Strength ![build status](https://codeship.com/projects/0fd512b0-c9f6-0134-86e7-125925b29f4b/status?branch=master)\n\nA password strength indicator field using [zxcvbn](https://github.com/dropbox/zxcvbn) to calculate a password strength score.\n\n_Note: zxcvbn is a large library it's recommended you split the codebase to manage bundle size._\n\n[Try it live!](https://reactpasswordstrength.netlify.com)\n\n## Install in your project\n\n`npm install --save react-password-strength`\n\n_Note: react/react-dom is a peer dependency. You should be using this in a React project._\n\n## Run the example locally\n\nSee the [example repo](https://github.com/mmw/react-password-strength-example)\n\n## Using the tool\n\n```\n\u003cReactPasswordStrength\n  className=\"customClass\"\n  style={{ display: 'none' }}\n  minLength={5}\n  minScore={2}\n  scoreWords={['weak', 'okay', 'good', 'strong', 'stronger']}\n  changeCallback={foo}\n  inputProps={{ name: \"password_input\", autoComplete: \"off\", className: \"form-control\" }}\n/\u003e\n```\n\n### Importing\n\nIf using ES6 imports:\n`import ReactPasswordStrength from 'react-password-strength';`\n\nUsing CommonJS require:\n`var ReactPasswordStrength = require('react-password-strength');`\n\nUsing in a __Universal JS App__ (server-side rendering):\n- Import component from `react-password-strength/dist/universal`\n- Include default style from `react-password-strength/dist/style.css`.\n\n### Props\n\n#### ClassName\n\n- ClassName to render with default container classes\n\n#### Style\n\n- Style object to customize container\n\n#### minLength (Default: 5)\n\n- Minimum password length acceptable for password to be considered valid\n\n#### minScore (Default: 2)\n\n- Minimum score acceptable for password to be considered valid\n- Scale from 0 - 4 denoting too guessable to very unguessable\n- See [zxcvbn](https://github.com/dropbox/zxcvbn) docs for more detail\n\n#### scoreWords (Default: ['weak', 'weak', 'okay', 'good', 'strong'])\n\n- An array denoting the words used to describe respective score values in the UI\n\n#### tooShortWord (Default: 'too short')\n\n- A string to describe when password is too short (based on minLength prop).\n\n#### changeCallback\n\n- Callback after input has changed (and score was recomputed)\n- React Password Strength passes two objects to the callback function:\n    - current app state (`score`, `password`, `isValid`)\n    - full result produced by [zxcvbn](https://github.com/dropbox/zxcvbn) including `feedback` (see docs for more properties)\n\n#### inputProps\n\n- Props to pass down to the `input` element of the component. Things like `name`, `id`, etc\n- Protected props: `className`, `onChange`, `ref`, `value`\n  - Passing in `className` will append to the existing classes\n  - The remaining props will be ignored\n\n#### defaultValue\n\n- A default value to set for the password field. If a non-empty string is provided the `changeCallback` will be called in `componentDidMount`.\n\n#### userInputs\n\n- An array of strings that zxcvbn will treat as an extra dictionary.\n\n#### namespaceClassName (Default: 'ReactPasswordStrength')\n\n- Used to control the CSS class namespace. CSS classes created by RPS will be prepended with this string.\n- If you change this prop you have to provide all CSS and it's recommended to import RSP from the universal JS build (`react-password-strength/dist/universal`)\n\n### Classes\n\n_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._\n- `ReactPasswordStrength` - namespace class and component wrapper\n- `is-strength-{0-4}` - modifier class indicating password strength\n- `ReactPasswordStrength-input` - password input field\n- `is-password-valid` - modifier class indicating valid password\n- `is-password-invalid` - modifier class indicating invalid password (only applies if password length \u003e 0)\n- `ReactPasswordStrength-strength-bar` - color bar indicating password strength\n- `ReactPasswordStrength-strength-desc` - text indicating password strength\n\n\n### Functions\n\n_Access through `ref` handle of ReactPasswordStrength._\n- `clear` - reset password field to initial state\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmw%2Freact-password-strength","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmw%2Freact-password-strength","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmw%2Freact-password-strength/lists"}