7c-react-loader 中文文档教程
7c-react-loader
ReactJS 的简单“加载器”库。 制作漂亮的动画加载器。
Installation
通过 npm/yarn 使用 7c-react-loader
npm install 7c-react-loader --save
或
yarn add 7c-react-loader
Basic usage
import Loader from '7c-react-loader';
<Loader active={true}>
<div>Lorem ipsum</div>
</Loader>
Properties
Prop name | Is required | Type of value | Description | Default value |
---|---|---|---|---|
active | YES | boolean | Loader should be shown. For 'true' CSS classes defined in className prop will be added to | - |
children | NO | element | Content to render | - |
activeClassName | NO | Any type accepted by classNames | CSS classes that will be added to | "7c-react-loader-active" |
delay | NO | integer | Delayed defined in milliseconds after with CSS classes will be applied to | 0 |
disabledClassName | NO | Any type accepted by classNames | CSS classes that will be added to | "7c-react-loader-disabled" |
tag | NO | string or function | Tag of | div |
Usage
CSS 类(默认:“7c-react-loader-active”)安装将立即应用于
<Loader active={true}>
...
</Loader>
CSS 类将在 500 毫秒后应用于
<Loader active={true} delay={500}>
...
CSS 类“loader-active”将在 500 毫秒后应用于
<Loader active={true} activeClassName="loader-active" disabledClassName="loader-disabled" tag="span" delay={500}>
...
Dependencies
7c-react-loader 要求:
- React >= 16.3.2
- classNames >= 2.2.5
License
MIT License
Copyright (c) 2018 Michał Parulski http://opensource.org/licenses/MIT
7c-react-loader
Simple “loader” library for ReactJS. Makes beautiful, animated loader.
Installation
Install by npm/yarn with 7c-react-loader
npm install 7c-react-loader --save
or
yarn add 7c-react-loader
Basic usage
import Loader from '7c-react-loader';
<Loader active={true}>
<div>Lorem ipsum</div>
</Loader>
Properties
Prop name | Is required | Type of value | Description | Default value |
---|---|---|---|---|
active | YES | boolean | Loader should be shown. For 'true' CSS classes defined in className prop will be added to | - |
children | NO | element | Content to render | - |
activeClassName | NO | Any type accepted by classNames | CSS classes that will be added to | "7c-react-loader-active" |
delay | NO | integer | Delayed defined in milliseconds after with CSS classes will be applied to | 0 |
disabledClassName | NO | Any type accepted by classNames | CSS classes that will be added to | "7c-react-loader-disabled" |
tag | NO | string or function | Tag of | div |
Usage
CSS classes (default: "7c-react-loader-active") will be applied to
<Loader active={true}>
...
</Loader>
CSS classes will be applied to
<Loader active={true} delay={500}>
...
CSS class "loader-active" will be applied to
<Loader active={true} activeClassName="loader-active" disabledClassName="loader-disabled" tag="span" delay={500}>
...
Dependencies
7c-react-loader requires:
- React >= 16.3.2
- classNames >= 2.2.5
License
MIT License
Copyright (c) 2018 Michał Parulski http://opensource.org/licenses/MIT