Some `react` login pages, which can be used quickly after installation.
Some `react` login pages, which can be used quickly after installation.
React Login Pages
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.
This component is designed to facilitate the development of additional login pages and offers a highly flexible API for modifying packaged login page components.
npm install react-login-page --saveimport 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.
…LogoThere are two default logos built-in, with a special way to import them. See below for reference:
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.
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.Blockimport Login, { Block } from 'react-login-page';
Login
Loginimport 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.Inputimport Login, { Input } from 'react-login-page';
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;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
Remember me
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.Textareaimport Login, { Textarea } from 'react-login-page';
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;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.Selectimport Login, { Select } from 'react-login-page';
One
Two
One
Two
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;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.Buttonimport Login, { Button } from 'react-login-page';
Login
Loginimport 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;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>;Renderimport { Render } from 'react-login-page';
{({ fields, buttons, blocks, extra, $$index }, data) => {
// data.blocks => Array
// data.buttons => Array
// data.fields => Array
return (
);
}}
;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
{({ blocks, extra, $$index }, { fields, buttons }) => {
return (
);
}}
useStoreimport 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
…As always, thanks to our amazing contributors!
Made with contributors.
Licensed under the MIT License.
No open issues yet, or sync has not completed.