lesca-react-loading
Version:
simple loading component
62 lines (45 loc) • 2.3 kB
Markdown
[](https://zh-hant.reactjs.org/)
[](https://lesscss.org/)
[](https://www.typescriptlang.org/)
[](https://www.w3schools.com/html/)
[](https://www.w3schools.com/css/)
[](https://www.npmjs.com/)
[](https://nodejs.org/en/)
[](https://www.npmjs.com/~jameshsu1125)
# Why use it?
a simple process loading of react component.
look like this.
<img src='http://archive.lesca.net/loading.gif' width='200' height='200' />
#### [Live Demo](https://jameshsu1125.github.io/lesca-react-loading/)
# Installation
```sh
npm install lesca-react-loading --save
```
## Usage
As a Node module:
```JSX
import { useState } from 'react';
import LoadingProcess from 'lesca-react-loading';
const Page = () => {
const [uploading, setUploading] = useState(false);
return (
<div>
{ uploading && (
<LoadingProcess backgroundColor='#00ff66' iconColor='#f60' scale={0.8}>
<span className='inner'>uploading...</span>
</LoadingProcess>
)}
</div>
);
};
```
## Development
### Porps
| props | description | default |
| :--------------------------- | :-----------------------: | ---------------: |
| **position**:_string_ | set position of component | 'fixed' |
| **scale**:_number_ | icon scale | 1 |
| **backgroundColor**:_string_ | set background color | 'rgba(0,0,0,.8)' |
| **iconColor**:_object_ | set icon color | '#fff' |
### Features
- maintain if necessary