@react-login-page/page6
v1.0.4
Published
Some `react` login pages, which can be used quickly after installation.
Downloads
132
Readme
@react-login-page/page6
Install
$ npm install @react-login-page/page6 --save
Usage
import React from 'react';
import Login from '@react-login-page/page6';
const Demo = () => <Login style={{ height: 690 }} />;
export default Demo;
Modify Controls
import React from 'react';
import LoginPage, { Username, Password, Submit, Title, Logo } from '@react-login-page/page6';
import LoginLogo from 'react-login-page/logo';
const styles = { height: 690 };
const Demo = () => (
<div style={styles}>
<LoginPage>
<Username label="用户名" name="userUserName" />
<Password label="密码" placeholder="请输入密码" name="userPassword" />
<Submit>提交</Submit>
<Submit type="reset" name="reset">
重置
</Submit>
<Title />
<Logo>
<LoginLogo />
</Logo>
</LoginPage>
</div>
);
export default Demo;
Hide Controls
Use visible={false}
to hide controls.
import React from 'react';
import LoginPage, { Reset, Logo, Password, Footer } from '@react-login-page/page6';
import LoginLogo from 'react-login-page/logo-rect';
const Demo = () => (
<LoginPage style={{ height: 690 }}>
<Logo>
<LoginLogo />
</Logo>
<Password visible={false} />
<Footer>
Not a member? <a href="#">Sign up now</a>
</Footer>
</LoginPage>
);
export default Demo;
Add Controls
import React from 'react';
import LoginPage, { Reset, Logo, Footer, Username, Password, Input } from '@react-login-page/page6';
import LoginLogo from 'react-login-page/logo-rect';
const imgSrc =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAYAAADDhn8LAAAMuElEQVR42u2d+XMUxxXH/Se4KpVK4h9SqUpSyU+plA/iOITYFRKnSEjZsQuDDARsHBMC2OG+rxCEQQYjc1tYRsgSiFMcEuKSkJDQgUCAECAJdiWZFatbQrd2t6M3zordUb+enp3Z2UPvW/UKSprpbpv3menX/V7PM4xEIqF6hv4XkEgECIlEgJBIBAiJRICQSAQIiUSAkEgECIlEgJBIBAiJRCJASCQChEQiQEgkAoREIkBIJAKERCJASCQChEQiQEgkXF9vuTzMCBASgSGAIdpAIUBIuuEw8zoChDTi4IgmSAgQUlCdPdIhIUBIQXfySIaEACFZ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qL8rFAG52Y4bV7JTxQLJ0DKquy6nvh6bNp/t7O+/gHLAREttcqU10q/gVUFUZjZzhSbB4goP8trEKtYHZxHKyCgXSeyTIfjrRWblXgEZDUgos06v/LaxHOG+sGqEtUG4zENEK3zs0IVnEczIKD1+4+YBgcE6U1tT2t6rAYExDt0Wra8VlZYXbuvwa67V6Z9J12UnxWq4NwsQHz/DCdAQPszc4RLvzIWl3pSmVb5KhSAYLvdfuW1Ay5jD3OkDBfbpTcNkPKMzrALzo06rS8U4QoIyOZwsuV7U3WDsnDnAVZZx0/4CwUgWNbuUHnt6gOm9ON7MBzPYNfddEAOzcYPhMtPaGORqEAACaUgfkjPK2FrE9OUYHvsx+uUnXEw+Dv8DH4H2boNre2MpC1TANGqOYffx4x61s8IENKIAUSU1g4FUzwgIgESAoRkCiCQnYsB8vdfvILeF+6QECAkw4DA6hQGR9wrNUIIIgkQgoQACUiJkx0oIHDcjxYE4QoJDwYChADRJVEe1tLnqtm7L/5Asw0ChBS1gMDXaDFATq5olHb+cISEACEZAkSU5g5LvlOe/5l0WwQIKeIBgXyrNscAK0lpFx7G4P00mx6nJ0BIEQeIniIo9WfZ4DPPBAiJAOFYUVK7bqcnQEgjApCkaY6AHT7cICFASKYCAgfJeb94S4CQCBCfA6vV2boECCnqAYESWZ5Bdi6kkCTPqFdKbV19HlOcnQAhRRQgRkSAkAgQAoREgBAgBAgBQoAQICQChAAhESAECIkAIUBIBAgBQgoD/Q8QZpUThrhrWAAAAABJRU5ErkJggg==';
const Demo = () => (
<LoginPage style={{ height: 990 }}>
<Logo>
<LoginLogo />
</Logo>
<Username keyname="subtitle" visible={false} index={0}>
欢迎登录页面
</Username>
{/* hide default username field */}
<Username visible={false} />
<Username keyname="user" index={3} placeholder="修改了 name 字段" />
<Username keyname="code" index={2} label="验证码">
<img src={imgSrc} height={38} />
</Username>
<Username keyname="username_rule" visible={false} index={4}>
用户名规则
</Username>
<Password index={1} />
<Input name="phone" index={2} placeholder="Phone number">
<img src={imgSrc} height={38} />
</Input>
<Footer>
Not a member? <a href="#">Sign up now</a>
</Footer>
</LoginPage>
);
export default Demo;
Modify default control name
Modify the string that specifies the name
of the input control by default
- remove default
name=username
controls
<Username visible={false} />
- add
name=user
controls
<Username keyname="user" index={3} placeholder="修改了 name 字段" />
Modify Color Style
import React from 'react';
import Login from '@react-login-page/page6';
const css = {
'--login-bg': '#5b6ef4',
'--login-color': '#fff',
'--login-input': '#333',
'--login-input-bg': '#fff',
'--login-inner-before': 'linear-gradient(#3ee4f0, #0b94ef)',
'--login-inner-after': 'linear-gradient(to right, #fff62f, #ffa204)',
'--login-btn': '#fff',
'--login-btn-bg': '#5b6ef4',
'--login-btn-focus': '#3648c6',
'--login-btn-hover': '#3648c6',
'--login-btn-active': '#5b6ef4',
'--login-footer': '#ffffff99',
};
const Demo = () => <Login style={{ height: 690, ...css }} />;
export default Demo;
Use css variables to override default color values
.login-page5 {
--login-bg: #080710;
--login-inner-bg: white;
--login-color: #fff;
--login-input: #fff;
--login-input-bg: rgb(55 55 62);
--login-inner-before: linear-gradient(#1845ad, #23a2f6);
--login-inner-after: linear-gradient(to right, #ff512f, #f09819);
--login-btn: #fff;
--login-btn-bg: rgba(255, 255, 255, 0.07);
--login-btn-focus: transition;
--login-btn-hover: #1845ad;
--login-btn-active: #f09819;
--login-footer: #ffffff99;
}
Custom CSS style overrides
.login-page5 section button:focus {
box-shadow: 0 0 0 2px rgba(0, 142, 240, 0.26);
}
.login-page5 section button:hover {
background-color: #0070bd;
}
.login-page5 section button:active {
background-color: #00528a;
}
Light & Dark Theme
[data-color-mode*='dark'] .login-page6,
.login-page6 {
--login-bg: #080710;
--login-inner-bg: white;
--login-color: #fff;
--login-input: #fff;
--login-input-bg: rgb(55 55 62);
--login-inner-before: linear-gradient(#1845ad, #23a2f6);
--login-inner-after: linear-gradient(to right, #ff512f, #f09819);
--login-btn: #fff;
--login-btn-bg: rgba(255, 255, 255, 0.07);
--login-btn-focus: transition;
--login-btn-hover: #1845ad;
--login-btn-active: #f09819;
--login-footer: #ffffff99;
}
[data-color-mode*='light'] .login-page6 {
--login-bg: #080710;
--login-inner-bg: white;
--login-color: #fff;
--login-input: #fff;
--login-input-bg: rgb(55 55 62);
--login-input-before: rgba(69, 105, 144, 0.15);
--login-input-after: rgba(2, 128, 144, 0.2);
--login-btn: #fff;
--login-btn-bg: rgba(255, 255, 255, 0.07);
--login-btn-focus: transition;
--login-btn-hover: #1845ad;
--login-btn-active: #f09819;
--login-footer: #ffffff99;
}
API
Components be provided to modify control properties and perform other related functions.
import LoginPage from '@react-login-page/page6';
// buttons
import { Reset, Submit } from '@react-login-page/page6';
// blocks
import { Logo, Title, Footer } from '@react-login-page/page6';
// fields
import { Username, Password } from '@react-login-page/page6';
// Basic Components
import { Button, Input } from '@react-login-page/page6';
// or
import { Button, Input } from 'react-login-page';
<LoginPage>
<Password index={2} />
</LoginPage>
<Input name="phone" index={1} placeholder="Phone number">
<img src="..." height={38} />
</Input>
// Define the order of `Password` controls
<Password index={2} />
// Hiding the `Password` control
<Password visible={false} />
// Add input control
<Input name="phone" index={1} placeholder="Phone number" />
// Add footer content
<Footer>
Not a member? <a href="#">Sign up now</a>
</Footer>
// Modify logo image
<Logo>⚛️</Logo>
Use dot notation components.
import Login from '@react-login-page/page6';
<Login>
<Login.Password index={2} />
</Login>
// Define the order of `Password` controls
<Login.Password index={2} />
// Hiding the `Password` control
<Login.Password visible={false} />
// Add footer content
<Login.Footer>
Not a member? <a href="#">Sign up now</a>
</Login.Footer>
// Modify logo image
<Login.Logo>⚛️</Login.Logo>
Contributors
As always, thanks to our amazing contributors!
Made with contributors.
License
Licensed under the MIT License.