百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-login-page

> 前端框架
开源

一些 `React` 登录页面,安装后可以快速使用。

700 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一些 `React` 登录页面,安装后可以快速使用。

React Login Pages

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. We also welcome recommendations for more cool login pages, which we will turn into React components.

For more login pages, install and use directly here.

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

javascript
import React from 'react';
import Login, { Render } from 'react-login-page';
import Logo from 'react-login-page/logo';

const Demo = () => {
  return (
    
      
        {({ fields, buttons, blocks, $$index }) => {
          return (
            

              

              

            
          );
        }}
      
      
        
      
      
        Login
      
      
      
      
        Submit
      
      
        Reset
      
    
  );
};
export default Demo;

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

…

Logo

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

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

javascript
import React from 'react';
import Logo from 'react-login-page/logo';
import LogoRect from 'react-login-page/logo-rect';

const Demo = () => {
  return (
    

  );
};
export default Demo;

Login.Block

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

Login
Login
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  const [name, setName] = React.useState(1);
  return (
    
      {({ blocks, fields, $$index, extra }, data) => {blocks.title}}
      {name} Login
       setName(name + 1)}>++
    
  );
};
export default Demo;
…

Login.Input

javascript
import Login, { Input } from 'react-login-page';
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    
      
        {({ blocks, fields, $$index, extra }, data) => (
          
            {fields.password} {extra.password}
          
        )}
      
      
         extra content 
      
    
  );
};
export default Demo;
typescript
import React, { FC, PropsWithChildren } from 'react';
export interface InputProps extends React.InputHTMLAttributes {
  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>;

Input can display extra content

javascript

   Remember me 
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';
import Logo from 'react-login-page/logo-rect';

const Demo = () => {
  return (
    
      
        {({ blocks, fields, $$index, extra }, data) => {
          return (
            
              {fields.checkbox} {extra.checkbox}
            
          );
        }}
      
      
         Remember me 
      
    
  );
};
export default Demo;

Login.Textarea

javascript
import Login, { Textarea } from 'react-login-page';
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    
      
        {({ blocks, fields, $$index, extra }, data) => (
          
            {fields.textarea} {extra.textarea}
          
        )}
      
      
        extra content
      
    
  );
};
export default Demo;
typescript
import React, { FC, PropsWithChildren } from 'react';
export interface TextareaProps extends React.InputHTMLAttributes {
  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>;

Login.Select

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

  One
  Two

  One
  Two
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    
      {({ blocks, fields, $$index, extra }, data) => {fields.selectname}}
      
        One
        Two
      
    
  );
};
export default Demo;
typescript
import React, { FC, PropsWithChildren } from 'react';
export interface SelectProps extends React.InputHTMLAttributes {
  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>;

Login.Button

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

Login
Login
javascript
import React from 'react';
import Login, { Render } from 'react-login-page';

const Demo = () => {
  return (
    
      {({ blocks, buttons, fields, $$index, extra }, data) => {buttons.submit}}
      
        Login
      
    
  );
};
export default Demo;
javascript
import type { FC, PropsWithChildren } from 'react';
export interface ButtonProps extends React.ButtonHTMLAttributes {
  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>;

Render

javascript
import { Render } from 'react-login-page';

  {({ fields, buttons, blocks, extra, $$index }, data) => {
    // data.blocks  => Array
    // data.buttons => Array
    // data.fields  => Array
    return (
      

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

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

typescript

  {({ blocks, extra, $$index }, { fields, buttons }) => {
    return (
      

      
    );
  }}

useStore

javascript
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 (
    
      
        {blocks.logo} {blocks.title}
      
      {fields.username}
      {fields.password}
      

    
  );
};

const Demo = () => {
  return (
    
      
        
      
      
        ⚛️
      
      
        Login
      
      
      
      
        Submit
      
      
        Reset
      
    
  );
};

export default Demo;

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

…

Contributors

As always, thanks to our amazing contributors!

Made with contributors.

License

Licensed under the MIT License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptloginlogin-pagereactreact-login-page

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架