0.2.0 • Published 4 years ago
@filipecovas/sweet-password-strength v0.2.0
sweet-password-strength
Sweet Password Strength React Component Guide
Congrats! You are just a few steps away from using the component. (Under Construction!!!)
This package is based on password-validator
Installation
Use the package manager npm to install.
npm install @filipecovas/sweet-password-strengthUsage
import React, { useState } from 'react';
import { SweetPasswordStrength } from '@filipecovas/sweet-password-strength';
const App: React.FC = () => {
const [value, setValue] = useState < string > '';
return (
<>
<input
type="password"
name="password"
value={value}
onChange={e => setValue(e.target.value)}
/>
<SweetPasswordStrength
password={value}
onChange={PasswordStrenghtState => console.log(PasswordStrenghtState)}
/>
</>
);
};
export default App;Props
password: string
- isRequired: true
- default: undefined
onChange: (password) => void
- isRequired: true
- default: undefined
Contributing
First fork the project and follow the commands below.
npm i && npm link && cd example && npm i && npm link @filipecovas/sweet-password-strength && cd ../ npm start cd example && npm run devPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
