A sleek and customizable password generator built with React — generate secure passwords using advanced setting options, smart defaults, and a beautiful UI.
-
🎚 Sliders for Control – Easily drag to set password length and how many you want to generate.
-
🔠 Character Options – Toggle uppercase, lowercase, numbers, and special symbols.
-
🎛 Advanced Toggle – One switch to unlock detailed customization like character sets with 🔄 reset functionality.
-
⚡ Instant Copy – Click on a generated password to copy one and
📋Iconto copy all. -
🔔 Toast Notifications – Feedback on copy actions and generation events.
-
🌈 Responsive UI – Built with modern React practices, clean design with animated switch and tailored for a smooth UX.
-
📦 State Management – Context API to manage settings cleanly and controlled inputs via React State.
-
✨ Pure React and JavaScript – No external libraries used.
Live Preview: 👉 Check it out on Vercel
git clone https://github.com/mahesh-pgit/cipher-gen
cd cipher-gen
npm install
npm startThe app will open at http://localhost:3000
-
Context-Based State Management:
All user settings like password length, count, and character types are stored globally in
SettingsContext.jsusingReact.createContext, allowing seamless access and updates across components. -
Sliders for Dynamic Input:
Sliders in
LengthSetting.jsandCountSetting.jsallow users to adjust password length and number of passwords. These are bound to context state for real-time updates. -
Character Type Toggles:
Each individual toggle component (
LowercaseLettersSetting.js,UppercaseLettersSetting.js, etc.) updates the context based on checkbox inputs, determining which character sets will be included. -
Advanced Toggle Switch:
The advanced toggle switch (
AdvancedToggleSwitch.js) expands and collapses the additional password customization options dynamically keeping the UI clean by default. -
Input Sanitization:
Each character input field removes duplicate characters and characters that don’t match the expected type (e.g., only lowercase in
LowercaseLettersSetting.js). -
Password Generation:
The
GenerateButtontriggers a utility functiongeneratePassword()which validates that at least one character type is selected and randomly assembles characters based on user preferences giving instant feedback on success:✅ "Password(s) generated successfully"
-
Error Handling & Feedback:
If no character types are selected, a toast message is shown:
❗"To generate password you must select at least one checkbox"
If character type is selected but no characters are provided (in advanced mode), a toast message is shown:
❗"No characters are provided for password generation"
-
Copy-to-Clipboard Functionality:
- Clicking a generated password (inside
PasswordContainer.js) copies it to clipboard using thenavigator.clipboard.writeText()API and shows a confirmation toast:
☑️ "Password is copied to clipboard"
- If multiple passwords are generated, it enables a "Copy All" button that copies the entire password list at once and shows a confirmation toast:
☑️ "All passwords are copied to clipboard"
- Clicking a generated password (inside
-
Toast Notifications:
-
ToastContainer.jshandles notifications with:-
Dynamic messages (like
"Password is copied to clipboard") -
Auto-dismiss after 2 seconds
-
Stackable design so multiple messages don't overlap
-
-
-
Component-Based Layout:
The app is modularly structured with reusable components, each handling a specific piece of UI logic, allowing for easy maintenance and future expansion.
-
🛠️ Adjust the default settings in
SettingsContext.jsto change the initial state of the app. -
💡 To increase password length or quantity, update the
maxvalues inLengthSetting.jsandCountSetting.jsaccordingly. -
🔔 Modify
ToastContainer.jsto change notification duration or style it using library likereact-toastifyfor more features. -
🎨 Style it your way by replacing
background.webpinsrc/assets/and tweakApp.css. -
🎭 Customize UI and use your own icons by editing
SVGs.js.
-
🌘 Dark mode support with smooth transitions
-
📋 Password strength indicator
-
💾 Save settings via
localStorage -
📦 Export passwords to CSV
-
🧠 AI-generated memorable passphrases
-
🌍 Multi-language UI support
Built with 💙 by Mahesh
A passionate React developer focused on building clean and powerful user interfaces.
This project was developed entirely by me without any templates or third-party starter kits. All code, structure, and logic are original unless otherwise credited.