New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

bnp-react-auth

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bnp-react-auth

A flexible and customizable login component for React applications, built with Material-UI. This component provides an easy way to create a login form with validation support.

latest
Source
npmnpm
Version
0.1.9
Version published
Maintainers
1
Created
Source

React Login Component

A flexible and customizable login component for React applications, built with Material-UI. This component provides an easy way to create a login form with validation support.

Installation

You can install this component using npm:

npm install bnp-react-auth

Usage

To use the Login component in your React application, follow these steps:

  • Import the Login component:
import Login from 'bnp-react-auth';
  • Render the Login component in your JSX code:
<Login
  headerLabel="Sign In"
  loginButtonLabel="Login"
  emailFieldLabel="Email Address"
  passwordFieldLabel="Password"
  emailFieldHelperText="Enter your email address"
  passwordFieldHelperText="Enter your password"
  inputFieldSize="normal"
  loginButtonSize="normal"
  loginButtonColor="primary"
  onLogin={handleLogin}
  validators={
    {
        email: (email: string) => !!email,
        password: (password: string) => !!password,
    }
    }
/>
  • Implement the handleLogin function to handle the login process. It will be called when the login button is clicked.
const handleLogin = ({ email, password }) => {
  // Implement your login logic here
};

Props

  • headerLabel (optional): Set the header label for the login form.
  • loginButtonLabel (optional): Set the label for the login button.
  • emailFieldLabel (optional): Set the label for the email input field.
  • passwordFieldLabel (optional): Set the label for the password input field.
  • emailFieldHelperText (optional): Set helper text for the email input field.
  • passwordFieldHelperText (optional): Set helper text for the password input field.
  • inputFieldSize (optional): Set the size of the input fields (small, normal, or large).
  • loginButtonSize (optional): Set the size of the login button (small, normal, or large).
  • loginButtonColor (optional): Set the color of the login button.
  • onLogin (optional): Callback function to handle the login process.
  • validators (optional): An object containing validation functions for email and password. You can also specify custom error text for validation failures.
  • onChange (optional): Callback function for input field changes.
  • customLoginButton (optional): Provide a custom JSX element for the login button.

GitHub Repository

You can find the source code for this component on GitHub.

License

This component is open-source and available under the MIT License. Feel free to use and modify it in your projects.

Keywords

react

FAQs

Package last updated on 01 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts