This project is a Password Generator App built using React. The app allows users to generate secure passwords with customizable options such as length, inclusion of numbers, and special characters. The generated password can be easily copied to the clipboard for use.
- Generate secure passwords of customizable length.
- Option to include numbers and special characters in the password.
- Real-time password preview.
- Copy the generated password to the clipboard with a single click.
- Clean and responsive UI.
This app leverages the following React hooks:
-
useState
Used to manage state for:- Password length (
length) - Whether numbers are allowed (
numberAllowed) - Whether special characters are allowed (
charAllowed) - The generated password (
password)
- Password length (
-
useRef
Used to create a reference to the password input field (passwordRef) for the copy-to-clipboard functionality. -
useCallback
Used to memoize functions:passwordGenerator: Generates a password based on selected options.copyPasswordToClipboard: Copies the generated password to the clipboard.
-
useEffect
Used to invoke thepasswordGeneratorfunction whenever the password length, number allowance, or special character allowance changes.
- Clone the repository:
git clone https://github.com/batoolarifa/password-generator-React.git
- Navigate to the project directory:
cd password-generator-app - Install dependencies:
npm install
- Start the development server:
npm start dev
The app uses a minimalistic design with:
- Password input field for displaying the generated password.
- Range slider for adjusting password length.
- Checkboxes for enabling/disabling numbers and special characters.
- Button for copying the password to the clipboard.
- React: For building the user interface.
- Tailwind CSS: For styling the components.
Enjoy using the Password Generator App! 🚀
