A modern, customizable password generator built with React Hooks and Tailwind CSS, focused on clean state management, controlled components, and optimized re-renders.
🌐 Live Demo: https://dhruv-gupta-dev.github.io/Password_Generator/
This project generates secure, customizable passwords with dynamic configuration options. It was built to strengthen understanding of:
- React Hooks lifecycle
- Controlled vs uncontrolled inputs
- Random generation logic
- Clipboard API integration
- Static deployment with GitHub Pages
The goal was not just to build a UI — but to implement clean, scalable React patterns.
-
Adjustable password length (6–100)
-
Toggle inclusion of:
- Numbers
- Special characters
-
Instant password regeneration on configuration change
-
Copy-to-clipboard functionality
-
Responsive UI using Tailwind CSS
-
Fully controlled React components
-
Optimized logic using
useCallback
Used:
useStatefor state managementuseEffectfor automatic password regenerationuseCallbackto memoize generation and copy logicuseReffor direct DOM selection control
Carefully structured dependency arrays to prevent unnecessary re-renders.
- Fixed off-by-one random index bug
- Converted range input to numeric type explicitly
- Converted checkboxes to controlled components
- React (Functional Components)
- Vite
- Tailwind CSS
- JavaScript (ES6+)
- GitHub Pages (Deployment)
git clone https://github.com/dhruv-gupta-dev/Password_Generator.git
cd Password_Generator
npm install
npm run devOpen:
http://localhost:5173
npm run buildThe optimized static files are generated inside the dist/ folder.
Deployed using:
- Vite production build
gh-pagespackage- GitHub Pages hosting
This project demonstrates understanding of static site deployment workflows.
- Implement
crypto.getRandomValues()for cryptographically secure randomness - Add password strength indicator
- Add visual copy success feedback
- Add accessibility improvements (ARIA attributes)
- Refactor into reusable component structure
- Strong understanding of React fundamentals
- Clean state-driven UI logic
- Awareness of performance considerations
- Ability to deploy production builds
- Attention to small but important implementation details
Dhruv Gupta @dhruv-gupta-dev
⭐ If you found this project interesting, feel free to star the repository.