Skip to content

batoolarifa/password-generator-React

Repository files navigation

Password Generator App

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.

Password Generator

Features

  • 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.

Hooks Used

This app leverages the following React hooks:

  1. useState
    Used to manage state for:

    • Password length (length)
    • Whether numbers are allowed (numberAllowed)
    • Whether special characters are allowed (charAllowed)
    • The generated password (password)
  2. useRef
    Used to create a reference to the password input field (passwordRef) for the copy-to-clipboard functionality.

  3. useCallback
    Used to memoize functions:

    • passwordGenerator: Generates a password based on selected options.
    • copyPasswordToClipboard: Copies the generated password to the clipboard.
  4. useEffect
    Used to invoke the passwordGenerator function whenever the password length, number allowance, or special character allowance changes.

Installation and Setup

  1. Clone the repository:
    git clone https://github.com/batoolarifa/password-generator-React.git
  2. Navigate to the project directory:
    cd password-generator-app
  3. Install dependencies:
    npm install
  4. Start the development server:
    npm start dev

UI Implementation

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.

Technologies Used

  • React: For building the user interface.
  • Tailwind CSS: For styling the components.

Enjoy using the Password Generator App! 🚀

About

A simple and visually appealing password generator app built with React. This app allows users to customize their password's length, include numbers, and add special characters for enhanced security.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages