# @scripty/react-login

> # Description

Latest version **0.1.3** (published 2020-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @scripty/react-login
pnpm add @scripty/react-login
yarn add @scripty/react-login
bun add @scripty/react-login
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2020-07-26 |
| First published | 2020-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 41.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Danijel Garic |
| Maintainers | garic |
| Keywords | react, navigations, react navigations, react components, react-breadcrumbs, breadcrumbs |

## Links

- npm: https://www.npmjs.com/package/@scripty/react-login
- Repository: https://github.com/scripty08/react-login
- Homepage: https://garic.biz
- Issues: https://github.com/scripty08/react-login/issues
- npm.io page: https://npm.io/package/@scripty/react-login

## Dependencies (9)

- [react](https://npm.io/package/react.md) 16.11.0
- [react-dom](https://npm.io/package/react-dom.md) 16.11.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@scripty/styles](https://npm.io/package/@scripty/styles.md) ^0.1.40
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^5.2.0
- [@scripty/react-card](https://npm.io/package/@scripty/react-card.md) ^0.1.7
- [@scripty/react-inputs](https://npm.io/package/@scripty/react-inputs.md) ^0.1.5
- [@scripty/react-buttons](https://npm.io/package/@scripty/react-buttons.md) ^0.1.7
- [@scripty/react-navigations](https://npm.io/package/@scripty/react-navigations.md) ^0.3.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2020-07-26
- 0.1.2 — 2020-07-26
- 0.1.1 — 2020-07-20
- 0.1.0 — 2020-07-12

## README

# @scripty/react-login

# Description

lightweight react login component.

![alt text](./login.png "@scripty/react-login")

# Usage
```bash
npm install -s @scripty/react-login
```

##### Client: Example.jsx

```javascript
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { Login } from '@scripty/react-login';

export const Example = () => {

    const onLoginSubmit = (data) => {
        const { username, password } = data;
        console.log(username, password);
    }

    const onRegisterSubmit = (data) => {
        const { username, password } = data;
        console.log(username, password);
    }

    const onForgotUsernameSubmit = (username) => {
        console.log(username);
    }

    const onForgotPasswordSubmit = (password) => {
        console.log(password);
    }

    return (
        <Router>
            <h2>Login</h2>
            <Login
                width={350}
                onLoginSubmit={onLoginSubmit}
                onRegisterSubmit={onRegisterSubmit}
                onForgotUsernameSubmit={onForgotUsernameSubmit}
                onForgotPasswordSubmit={onForgotPasswordSubmit}
                loginPath={'/login'}
                registerPath={'/register'}
            />
        </Router>
    );
};

```
# Components

Name              | Features                                                      |
----------------- |-------------------------------------------------------------- |
Login             | Reset password, forgot password, forgot username              |
Registration      |                                                               |

# Login Properties

Property                           | Type        |  Default / Description  |
-----------------------------------|------------ |-----------
title (optional)                   | String      | Login
width (optional)                   | number      | 100%
onLoginSubmit (required)           | Function    |
onRegisterSubmit (optional)        | Function    |
onForgotUsernameSubmit (optional)  | Function    |
onForgotPasswordSubmit (optional)  | Function    |
onPasswordReset (optional)         | Function    | url params :userId and :token needed. returns token, userId and new password
loginPath (optional)               | String      | /login
registerPath (optional)            | String      | /register

# Registration Properties

Property                     | Type           |  Default  |
---------------------------- |--------------- |-----------
registerPath (optional)      | String         | /register
title (optional)             | String         | Register
onRegisterSubmit (required)  | Function       |
children (optional)          | React Children |

---
_Source: https://npm.io/package/@scripty/react-login · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
