# react-login-page

> Some `react` login pages, which can be used quickly after installation.

Latest version **1.0.7** (published 2026-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-login-page
pnpm add react-login-page
yarn add react-login-page
bun add react-login-page
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2026-11-23 |
| First published | 2023-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 134.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 704 |
| Author | kenny wong |
| Maintainers | uiwjs, wcjiang |
| Keywords | react, login, login-page, login-pages, react-login, react-login-page, editor, syntax, ide, code |

## Links

- npm: https://www.npmjs.com/package/react-login-page
- Repository: https://github.com/uiwjs/react-login-page
- Homepage: https://uiwjs.github.io/react-login-page
- Issues: https://github.com/uiwjs/react-login-page/issues
- Funding: https://jaywcjlove.github.io/#/sponsor
- npm.io page: https://npm.io/package/react-login-page

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2026-11-23
- 1.0.6 — 2025-08-19
- 1.0.5 — 2025-05-01
- 1.0.4 — 2024-02-26
- 1.0.3 — 2024-02-26
- 1.0.2 — 2023-11-28
- 1.0.1 — 2023-09-22
- 1.0.0 — 2023-08-23
- 0.4.16 — 2023-05-19
- 0.4.15 — 2023-05-14
- 0.4.14 — 2023-05-04
- 0.4.13 — 2023-05-04
- 0.4.12 — 2023-05-03
- 0.4.11 — 2023-05-03
- 0.4.10 — 2023-05-03
- … 22 more at https://npm.io/package/react-login-page/versions

## README

<div markdown="1">
  <sup>Using <a href="https://wangchujiang.com/#/app" target="_blank">my app</a> is also a way to <a href="https://wangchujiang.com/#/sponsor" target="_blank">support</a> me:</sup>
  <br>
  <a target="_blank" href="https://wangchujiang.com/dock-lift/" title="DockLift: Windows, Here"><img alt="DockLift: Windows, Here" height="52" src="https://wangchujiang.com/appicon/dock-lift.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6766860898" title="Zipora: Zip/RAR/7Z Unarchiver"><img alt="Zipora: Zip/RAR/7Z Unarchiver" height="52" src="https://wangchujiang.com/appicon/zipora.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6758053530" title="Scap: Screenshot & Markup Edit for macOS"><img alt="Scap: Screenshot & Markup Edit" height="52" src="https://wangchujiang.com/appicon/scap.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6757317079" title="Screen Test for macOS"><img alt="Screen Test" height="52" src="https://wangchujiang.com/appicon/screen-test.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6755948110" title="Deskmark for macOS"><img alt="Deskmark" height="52" src="https://wangchujiang.com/appicon/deskmark.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6500434773" title="Keyzer for macOS"><img alt="Keyzer" height="52" src="https://wangchujiang.com/appicon/keyzer.png"></a>
  <a target="_blank" href="https://github.com/jaywcjlove/vidwall-hub" title="Vidwall Hub for macOS"><img alt="Vidwall Hub" height="52" src="https://wangchujiang.com/appicon/vidwall-hub.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6752624705" title="VidCrop for macOS"><img alt="VidCrop" height="52" src="https://wangchujiang.com/appicon/vidcrop.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6747587746" title="Vidwall for macOS"><img alt="Vidwall" height="52" src="https://wangchujiang.com/appicon/vidwall.png"></a>
  <a target="_blank" href="https://wangchujiang.com/mousio-hint/" title="Mousio Hint for macOS"><img alt="Mousio Hint" height="52" src="https://wangchujiang.com/appicon/mousio-hint.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6746747327" title="Mousio for macOS"><img alt="Mousio" height="52" src="https://wangchujiang.com/appicon/mousio.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6745227444" title="Musicer for macOS"><img alt="Musicer" height="52" src="https://wangchujiang.com/appicon/musicer.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6743841447" title="Audioer for macOS"><img alt="Audioer" height="52" src="https://wangchujiang.com/appicon/audioer.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6744690194" title="FileSentinel for macOS"><img alt="FileSentinel" height="52" src="https://wangchujiang.com/appicon/file-sentinel.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6743495172" title="FocusCursor for macOS"><img alt="FocusCursor" height="52" src="https://wangchujiang.com/appicon/focus-cursor.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6742680573" title="Videoer for macOS"><img alt="Videoer" height="52" src="https://wangchujiang.com/appicon/videoer.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6740425504" title="KeyClicker for macOS"><img alt="KeyClicker" height="52" src="https://wangchujiang.com/appicon/key-clicker.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6739052447" title="DayBar for macOS"><img alt="DayBar" height="52" src="https://wangchujiang.com/appicon/daybar.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6739444407" title="Iconed for macOS"><img alt="Iconed" height="52" src="https://wangchujiang.com/appicon/iconed.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6737160756" title="Menuist for macOS"><img alt="Menuist" height="52" src="https://wangchujiang.com/appicon/rightmenu-master.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6723903021" title="Paste Quick for macOS"><img alt="Quick RSS" height="52" src="https://wangchujiang.com/appicon/paste-quick.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6670696072&platform=mac" title="Quick RSS for macOS/iOS"><img alt="Quick RSS" height="52" src="https://wangchujiang.com/appicon/quick-rss.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6670167443" title="Web Serve for macOS"><img alt="Web Serve" height="52" src="https://wangchujiang.com/appicon/web-serve.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6503953628&platform=mac" title="Copybook Generator for macOS/iOS"><img alt="Copybook Generator" height="52" src="https://wangchujiang.com/appicon/copybook-generator.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6471227008&platform=mac" title="DevTutor for macOS/iOS"><img alt="DevTutor for SwiftUI" height="52" src="https://wangchujiang.com/appicon/devtutor.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6479819388&platform=mac" title="RegexMate for macOS/iOS"><img alt="RegexMate" height="52" src="https://wangchujiang.com/appicon/regex-mate.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6479194014&platform=mac" title="Time Passage for macOS/iOS"><img alt="Time Passage" height="52" src="https://wangchujiang.com/appicon/time-passage.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6478772538" title="IconizeFolder for macOS"><img alt="Iconize Folder" height="52" src="https://wangchujiang.com/appicon/iconize-folder.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6478511402&platform=mac" title="Textsound Saver for macOS/iOS"><img alt="Textsound Saver" height="52" src="https://wangchujiang.com/appicon/textsound-saver.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476924627" title="Create Custom Symbols for macOS"><img alt="Create Custom Symbols" height="52" src="https://wangchujiang.com/appicon/create-custom-symbols.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476452351" title="DevHub for macOS"><img alt="DevHub" height="52" src="https://wangchujiang.com/appicon/devhub.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476400184" title="Resume Revise for macOS"><img alt="Resume Revise" height="52" src="https://wangchujiang.com/appicon/resume-revise.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6472593276" title="Palette Genius for macOS"><img alt="Palette Genius" height="52" src="https://wangchujiang.com/appicon/palette-genius.png"></a>
  <a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6470879005" title="Symbol Scribe for macOS"><img alt="Symbol Scribe" height="52" src="https://wangchujiang.com/appicon/symbol-scribe.png"></a>
</div>
<hr>

<!--rehype:ignore:start-->
<br />
<br />
<br />
<br />
<br />
<p align="center">
  <a href="https://uiwjs.github.io/react-login-page">
    <img alt="react-codemirror logo" src="https://uiwjs.github.io/react-login-page/logo.svg">
  </a>
</p>
<h3 align="center">React Login Pages</h3>
<br />
<br />
<p align="center">
  <a href="https://jaywcjlove.github.io/#/sponsor" title="Buy me a coffee">
    <img src="https://img.shields.io/badge/Buy_Me_a_Coffee-ffdd00?logo=buy-me-a-coffee&logoColor=black" alt="Buy me a coffee">
  </a>
  <a href="https://x.com/jaywcjlove" title="Follow On X">
    <img src="https://img.shields.io/badge/Follow%20on%20X-333333?logo=x&logoColor=white" alt="Follow On X">
  </a>
  <a href="https://www.npmjs.com/package/react-login-page" target="__blank">
    <img alt="Downloads" src="https://img.shields.io/npm/dm/react-login-page.svg?style=flat">
  </a>
  <a href="https://www.jsdelivr.com/package/npm/react-login-page" target="__blank">
    <img alt="jsDelivr CDN" src="https://data.jsdelivr.com/v1/package/npm/react-login-page/badge?style=rounded" />
  </a>
  <a href="https://bundlephobia.com/package/react-login-page" target="__blank">
    <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/react-login-page">
  </a>
  <br />
  <a href="https://github.com/uiwjs/react-login-page/actions/workflows/main.yml" target="__blank">
    <img alt="Build & Deploy" src="https://github.com/uiwjs/react-login-page/actions/workflows/main.yml/badge.svg" />
  </a>
  <a href="https://uiwjs.github.io/react-login-page/lcov-report/" target="__blank">
    <img alt="Coverage Status" src="https://uiwjs.github.io/react-login-page/badges.svg" />
  </a>
  <a href="https://uiwjs.github.io/npm-unpkg/#/pkg/react-login-page/file/README.md" target="__blank">
    <img src="https://img.shields.io/badge/Open%20in-unpkg-blue" alt="Open in unpkg">
  </a>
  <a href="https://www.npmjs.com/package/react-login-page" target="__blank">
    <img alt="npm version" src="https://img.shields.io/npm/v/react-login-page.svg">
  </a>
  <a href="https://hellogithub.com/repository/49e71ff761fc4749bb0bbe87592c458a" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=49e71ff761fc4749bb0bbe87592c458a&claim_uid=ihlPcyk2p10TusQ&theme=small" alt="Featured｜HelloGitHub" /></a>
</p>

<br />
<br />
<br />

<!--rehype:ignore:end-->

# Getting Started

Encapsulated login page components based on `react-login-page` basic components are provided for quick installation and use. These components help streamline the process of creating login pages and offer flexible APIs for modifying and packaging these components. Welcome to choose from our encapsulated [login pages](https://uiwjs.github.io/react-login-page). We also welcome [recommendations](https://github.com/uiwjs/react-login-page/issues/new/choose) for more cool login pages, which we will turn into React components.

<!--rehype:ignore:start-->

<p align="center">
  <a href="https://uiwjs.github.io/react-login-page">
    <img alt="react-codemirror logo" src="https://user-images.githubusercontent.com/1680273/235319135-9f138e34-5d5d-48ce-914d-f242b31fdc09.png">
  </a>
</p>

For more login pages, install and use directly [here](https://uiwjs.github.io/react-login-page).

<!--rehype:ignore:end-->

## Packages

| Name                                                                                  | NPM Version                                                                                                                                                                                                                                                                           |
| :------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`react-login-page`](https://uiwjs.github.io/react-login-page/#/docs/getting-started) | [![npm version](https://img.shields.io/npm/v/react-login-page.svg)](https://www.npmjs.com/package/react-login-page) [![NPM Downloads](https://img.shields.io/npm/dm/react-login-page.svg?style=flat)](https://www.npmjs.com/package/react-login-page)                                 |
| [`@react-login-page/base`](https://uiwjs.github.io/react-login-page/#/pages/base)     | [![npm version](https://img.shields.io/npm/v/@react-login-page/base.svg)](https://www.npmjs.com/package/@react-login-page/base) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/base.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/base)         |
| [`@react-login-page/page1`](https://uiwjs.github.io/react-login-page/#/pages/page1)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page1.svg)](https://www.npmjs.com/package/@react-login-page/page1) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page1.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page1)     |
| [`@react-login-page/page2`](https://uiwjs.github.io/react-login-page/#/pages/page2)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page2.svg)](https://www.npmjs.com/package/@react-login-page/page2) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page2.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page2)     |
| [`@react-login-page/page3`](https://uiwjs.github.io/react-login-page/#/pages/page3)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page3.svg)](https://www.npmjs.com/package/@react-login-page/page3) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page3.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page3)     |
| [`@react-login-page/page4`](https://uiwjs.github.io/react-login-page/#/pages/page4)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page4.svg)](https://www.npmjs.com/package/@react-login-page/page4) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page4.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page4)     |
| [`@react-login-page/page5`](https://uiwjs.github.io/react-login-page/#/pages/page5)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page5.svg)](https://www.npmjs.com/package/@react-login-page/page5) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page5.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page5)     |
| [`@react-login-page/page6`](https://uiwjs.github.io/react-login-page/#/pages/page6)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page6.svg)](https://www.npmjs.com/package/@react-login-page/page6) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page6.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page6)     |
| [`@react-login-page/page7`](https://uiwjs.github.io/react-login-page/#/pages/page7)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page7.svg)](https://www.npmjs.com/package/@react-login-page/page7) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page7.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page7)     |
| [`@react-login-page/page8`](https://uiwjs.github.io/react-login-page/#/pages/page8)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page8.svg)](https://www.npmjs.com/package/@react-login-page/page8) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page8.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page8)     |
| [`@react-login-page/page9`](https://uiwjs.github.io/react-login-page/#/pages/page9)   | [![npm version](https://img.shields.io/npm/v/@react-login-page/page9.svg)](https://www.npmjs.com/package/@react-login-page/page9) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page9.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page9)     |
| [`@react-login-page/page10`](https://uiwjs.github.io/react-login-page/#/pages/page10) | [![npm version](https://img.shields.io/npm/v/@react-login-page/page10.svg)](https://www.npmjs.com/package/@react-login-page/page10) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page10.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page10) |
| [`@react-login-page/page11`](https://uiwjs.github.io/react-login-page/#/pages/page11) | [![npm version](https://img.shields.io/npm/v/@react-login-page/page11.svg)](https://www.npmjs.com/package/@react-login-page/page11) [![NPM Downloads](https://img.shields.io/npm/dm/@react-login-page/page11.svg?style=flat)](https://www.npmjs.com/package/@react-login-page/page11) |

## React Login Page

This component is designed to facilitate the development of additional login pages and offers a highly flexible API for modifying packaged login page components.

### Install

```bash
npm install react-login-page --save
```

### Usage

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';
import Logo from 'react-login-page/logo';

const Demo = () => {
  return (
    <Login>
      <Render>
        {({ fields, buttons, blocks, $$index }) => {
          return (
            <div>
              <header>
                {blocks.logo} {blocks.title}
              </header>
              <div>
                <label>{fields.username}</label>
              </div>
              <div>
                <label>{fields.password}</label>
              </div>
              <div>
                {buttons.submit}
                {buttons.reset}
              </div>
            </div>
          );
        }}
      </Render>
      <Login.Block keyname="logo" tagName="span">
        <Logo />
      </Login.Block>
      <Login.Block keyname="title" tagName="span">
        Login
      </Login.Block>
      <Login.Input keyname="username" placeholder="Please input Username" />
      <Login.Input keyname="password" placeholder="please enter password" />
      <Login.Button keyname="submit" type="submit">
        Submit
      </Login.Button>
      <Login.Button keyname="reset" type="reset">
        Reset
      </Login.Button>
    </Login>
  );
};
export default Demo;
```

Change the control order by using **`index`**, Provide more flexible API encapsulation.

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';
import Logo from 'react-login-page/logo-rect';

const Demo = () => {
  return (
    <Login>
      <Render>
        {({ blocks, extra, $$index }, { fields, buttons }) => {
          return (
            <div>
              <header>
                {blocks.logo} {blocks.title}
              </header>
              {fields
                .sort((a, b) => a.index - b.index)
                .map((item, idx) => {
                  return (
                    <div key={item.name + idx}>
                      <label>
                        {item.children} {extra[item.name]}
                      </label>
                    </div>
                  );
                })}
              <div>
                {buttons
                  .sort((a, b) => a.index - b.index)
                  .map((item, idx) => {
                    return React.cloneElement(item.children, {
                      ...item.props,
                      key: item.name + idx,
                    });
                  })}
              </div>
            </div>
          );
        }}
      </Render>
      <Login.Block keyname="logo" tagName="span">
        <Logo />
      </Login.Block>
      <Login.Block keyname="title" tagName="span">
        Login
      </Login.Block>
      <Login.Textarea name="note"></Login.Textarea>
      <Login.Select name="select" defaultValue="1">
        <option value="w">Choose an item...</option>
        <option value="1">One</option>
        <option value="2">Two</option>
        <option value="3">Three</option>
        <option value="4">Four</option>
      </Login.Select>
      <Login.Input name="checkbox" type="checkbox" index={3}>
        <span> Remember me </span>
      </Login.Input>
      <Login.Input name="username" index={1} placeholder="Please input Username" />
      <Login.Input name="password" index={0} placeholder="please enter password" />
      <Login.Button keyname="submit" index={1} type="submit">
        Submit
      </Login.Button>
      <Login.Button keyname="reset" index={0} type="reset">
        Reset
      </Login.Button>
    </Login>
  );
};
export default Demo;
```

### `Logo`

There are two default logos built-in, with a special way to import them. See below for reference:

```tsx
import Logo from 'react-login-page/logo';
import Logo from 'react-login-page/logo-rect';
```

⚠️ If you don't use them, they won't be packaged.

```jsx mdx:preview
import React from 'react';
import Logo from 'react-login-page/logo';
import LogoRect from 'react-login-page/logo-rect';

const Demo = () => {
  return (
    <div>
      <Logo />
      <br />
      <LogoRect />
    </div>
  );
};
export default Demo;
```

### `Login.Block`

```jsx
import Login, { Block } from 'react-login-page';

<Login.Block keyname="title">Login</Login.Block>
<Block keyname="title">Login</Block>
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  const [name, setName] = React.useState(1);
  return (
    <Login>
      <Render>{({ blocks, fields, $$index, extra }, data) => <label>{blocks.title}</label>}</Render>
      <Login.Block keyname="title">{name} Login</Login.Block>
      <button onClick={() => setName(name + 1)}>++</button>
    </Login>
  );
};
export default Demo;
```

```jsx
import { PropsWithChildren, AllHTMLAttributes } from 'react';
import { BlockTagType } from 'react-login-page';

export interface BlockProps<Tag extends BlockTagType> extends AllHTMLAttributes<Tag> {
  keyname?: string;
  /**
   * @deprecated use `keyname`
   */
  name?: string;
  /** Can be shown or hidden with controls */
  visible?: boolean;
  /** "index" refers to the use of indexes to control the order of controls, which can provide more flexible API encapsulation. */
  index?: number;
  /** custom created element */
  tagName?: T;
}
export declare const Block: {
  <Tag extends keyof JSX.IntrinsicElements = "div">(props: PropsWithChildren<Partial<BlockProps<Tag>>>): null;
  displayName: string;
};
```

### `Login.Input`

```jsx
import Login, { Input } from 'react-login-page';

<Login.Input name="password" type="password" placeholder="Password" />
<Input name="password" type="password" placeholder="Password" />
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    <Login>
      <Render>
        {({ blocks, fields, $$index, extra }, data) => (
          <label>
            {fields.password} {extra.password}
          </label>
        )}
      </Render>
      <Login.Input name="password" type="password" placeholder="Password">
        <span> extra content </span>
      </Login.Input>
    </Login>
  );
};
export default Demo;
```

```tsx
import React, { FC, PropsWithChildren } from 'react';
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
  keyname?: string;
  /**
   * Used to define the name of form controls
   * @deprecated use `name`
   */
  rename?: string;
  /** Can be shown or hidden with controls */
  visible?: boolean;
  /** "index" refers to the use of indexes to control the order of controls, which can provide more flexible API encapsulation. */
  index?: number;
}
export declare const Input: FC<PropsWithChildren<InputProps>>;
```

**`Input`** can display **extra** content

```jsx
<Login.Input name="checkbox" type="checkbox">
  <span> Remember me </span>
</Login.Input>
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';
import Logo from 'react-login-page/logo-rect';

const Demo = () => {
  return (
    <Login>
      <Render>
        {({ blocks, fields, $$index, extra }, data) => {
          return (
            <label>
              {fields.checkbox} {extra.checkbox}
            </label>
          );
        }}
      </Render>
      <Login.Input keyname="checkbox" type="checkbox">
        <span> Remember me </span>
      </Login.Input>
    </Login>
  );
};
export default Demo;
```

### `Login.Textarea`

```jsx
import Login, { Textarea } from 'react-login-page';

<Login.Textarea name="note" />
<Textarea name="note" />
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    <Login>
      <Render>
        {({ blocks, fields, $$index, extra }, data) => (
          <label>
            {fields.textarea} {extra.textarea}
          </label>
        )}
      </Render>
      <Login.Textarea keyname="textarea" defaultValue="default">
        extra content
      </Login.Textarea>
    </Login>
  );
};
export default Demo;
```

```ts
import React, { FC, PropsWithChildren } from 'react';
export interface TextareaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
  keyname?: string;
  /**
   * Used to define the name of form controls
   * @deprecated use `name`
   */
  rename?: string;
  /** Can be shown or hidden with controls */
  visible?: boolean;
  /** "index" refers to the use of indexes to control the order of controls, which can provide more flexible API encapsulation. */
  index?: number;
}
export declare const Textarea: FC<PropsWithChildren<TextareaProps>>;
```

### `Login.Select`

```jsx
import Login, { Select } from 'react-login-page';

<Login.Select name="selectname">
  <option value="1">One</option>
  <option value="2">Two</option>
</Login.Select>

<Select name="selectname">
  <option value="1">One</option>
  <option value="2">Two</option>
</Select>
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    <Login>
      <Render>{({ blocks, fields, $$index, extra }, data) => <label>{fields.selectname}</label>}</Render>
      <Login.Select name="selectname">
        <option value="1">One</option>
        <option value="2">Two</option>
      </Login.Select>
    </Login>
  );
};
export default Demo;
```

```ts
import React, { FC, PropsWithChildren } from 'react';
export interface SelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
  keyname?: string;
  /**
   * Used to define the name of form controls
   * @deprecated use `name`
   */
  rename?: string;
  /** Can be shown or hidden with controls */
  visible?: boolean;
  /** "index" refers to the use of indexes to control the order of controls, which can provide more flexible API encapsulation. */
  index?: number;
}
export declare const Select: FC<PropsWithChildren<SelectProps>>;
```

### `Login.Button`

```jsx
import Login, { Button } from 'react-login-page';

<Login.Button keyname="submit" type="submit">Login</Login.Button>
<Button keyname="submit" type="submit" />Login</Button>
```

```jsx mdx:preview
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    <Login>
      <Render>{({ blocks, buttons, fields, $$index, extra }, data) => <label>{buttons.submit}</label>}</Render>
      <Login.Button keyname="submit" type="submit">
        Login
      </Login.Button>
    </Login>
  );
};
export default Demo;
```

```jsx
import type { FC, PropsWithChildren } from 'react';
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  keyname?: string;
  /** Can be shown or hidden with controls */
  visible?: boolean;
  /** "index" refers to the use of indexes to control the order of controls, which can provide more flexible API encapsulation. */
  index?: number;
}
export declare const Button: FC<PropsWithChildren<ButtonProps>>;
```

### `Render`

```jsx
import { Render } from 'react-login-page';

<Render>
  {({ fields, buttons, blocks, extra, $$index }, data) => {
    // data.blocks  => Array
    // data.buttons => Array
    // data.fields  => Array
    return (
      <div>
        <header>
          {blocks.logo} {blocks.title}
        </header>
        <label>{fields.username}</label>
        <label>{fields.password}</label>
        <div>
          {buttons.submit}
          {buttons.reset}
        </div>
      </div>
    );
  }}
</Render>;
```

```tsx
import { type FC } from 'react';
import { RenderStateProps, InitialState } from 'react-login-page';
export type RenderChildren =
  | {
      children?: (props: Required<RenderStateProps>, data: InitialState['data']) => React.ReactNode;
    }
  | {
      children?: React.ReactNode;
    };
export declare const Render: FC<RenderChildren>;
```

**`index`** refers to the use of indexes to control the order of controls

```tsx
<Render>
  {({ blocks, extra, $$index }, { fields, buttons }) => {
    return (
      <div>
        <header>
          {blocks.logo} {blocks.title}
        </header>
        {fields
          .sort((a, b) => a.index - b.index)
          .map((item, idx) => {
            return <label key={item.name + idx}>{item.children}</label>;
          })}
        <div>
          {buttons
            .sort((a, b) => a.index - b.index)
            .map((item, idx) => {
              const child = item.children;
              if (!isValidElement(child)) return null;
              return cloneElement(child, {
                ...child.props,
                key: item.name + idx,
              });
            })}
        </div>
      </div>
    );
  }}
</Render>
```

### `useStore`

```jsx mdx:preview
import React from 'react';
import Login, { Render, Provider, Container, useStore } from 'react-login-page';

const RenderLoginPage = () => {
  const { fields, extra, $$index, buttons, blocks, data } = useStore();
  return (
    <Render>
      <header>
        {blocks.logo} {blocks.title}
      </header>
      <label>{fields.username}</label>
      <label>{fields.password}</label>
      <div>
        {buttons.submit}
        {buttons.reset}
      </div>
    </Render>
  );
};

const Demo = () => {
  return (
    <Provider>
      <Container>
        <RenderLoginPage />
      </Container>
      <Login.Block keyname="logo" tagName="span">
        ⚛️
      </Login.Block>
      <Login.Block keyname="title" tagName="span">
        Login
      </Login.Block>
      <Login.Input name="username" placeholder="Please input Username" />
      <Login.Input name="password" placeholder="please enter password" />
      <Login.Button keyname="submit" type="submit">
        Submit
      </Login.Button>
      <Login.Button keyname="reset" type="reset">
        Reset
      </Login.Button>
    </Provider>
  );
};

export default Demo;
```

**`index`** refers to the use of indexes to control the order of controls

```jsx mdx:preview
import React, { isValidElement, cloneElement } from 'react';
import Login, { Render, Provider, Container, useStore } from 'react-login-page';

const RenderLoginPage = () => {
  const { blocks, data, $$index, extra } = useStore();
  const { fields, buttons } = data;
  return (
    <Render>
      <header>
        {blocks.logo} {blocks.title}
      </header>
      {fields
        .sort((a, b) => a.index - b.index)
        .map((item, idx) => {
          return <label key={item.name + idx}>{item.children}</label>;
        })}
      <div>
        {buttons
          .sort((a, b) => a.index - b.index)
          .map((item, idx) => {
            const child = item.children;
            if (!isValidElement(child)) return null;
            return cloneElement(child, {
              ...child.props,
              key: item.name + idx,
            });
          })}
      </div>
    </Render>
  );
};

const Demo = () => {
  return (
    <Provider>
      <Container>
        <RenderLoginPage />
      </Container>
      <Login.Block keyname="logo" tagName="span">
        ⚛️
      </Login.Block>
      <Login.Block keyname="title" tagName="span">
        Login
      </Login.Block>
      <Login.Input name="username" index={1} placeholder="Please input Username" />
      <Login.Input name="password" placeholder="please enter password" />
      <Login.Button keyname="submit" index={1} type="submit">
        Submit
      </Login.Button>
      <Login.Button keyname="reset" type="reset">
        Reset
      </Login.Button>
    </Provider>
  );
};

export default Demo;
```

## Contributors

As always, thanks to our amazing contributors!

<a href="https://github.com/uiwjs/react-login-page/graphs/contributors">
  <img src="https://uiwjs.github.io/react-login-page/CONTRIBUTORS.svg" />
</a>

Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).

## License

Licensed under the MIT License.

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