Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/react-loading
Spinner component for react.
https://github.com/afeiship/react-loading
component react spinner
Last synced: 24 days ago
JSON representation
Spinner component for react.
- Host: GitHub
- URL: https://github.com/afeiship/react-loading
- Owner: afeiship
- License: mit
- Created: 2016-12-12T06:07:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-20T08:13:08.000Z (almost 4 years ago)
- Last Synced: 2024-10-12T11:02:38.476Z (3 months ago)
- Topics: component, react, spinner
- Language: JavaScript
- Size: 633 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# react-loading
> Spinner component for react.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install -S @jswork/react-loading
```## properties
| Name | Type | Required | Default | Description |
| ------------- | ------ | -------- | ----------------------- | --------------------------------------- |
| mainClassName | string | false | 'webkit-sassui-loading' | The loading key effect css className. |
| backdrop | union | false | - | Backdrop props or not display backdrop. |## usage
1. import css
```scss
@import "~@feizheng/webkit-sassui-backdrop";
@import "~@feizheng/webkit-sassui-loading";
@import "~@feizheng/react-loading/dist/style.scss";// customize your styles:
$react-loading-options: ()
```
2. import js
```js
import ReactLoading from '@feizheng/react-loading';
import ReactDOM from 'react-dom';
import React from 'react';
import { Controller } from '@feizheng/react-visible';
import './assets/style.scss';class App extends React.Component {
state = {
value: false
};componentDidMount() {
Controller.singleton(ReactLoading, {
// children: 'loading',
backdrop: {
transparent: true,
onClick: () => {
ReactLoading.dismiss(() => {
console.log('after dismiss');
});
}
}
});
}render() {
return (
{
ReactLoading.present(
() => {
console.log('after present');
},
{ children: `[ ${Math.random().toString(36).slice(-6)} ]` }
);
}}>
Show Dynamic Loading.
);
}
}ReactDOM.render(, document.getElementById('app'));
```## documentation
- https://afeiship.github.io/react-loading/## license
Code released under [the MIT license](https://github.com/afeiship/react-loading/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/react-loading
[version-url]: https://npmjs.org/package/@jswork/react-loading[license-image]: https://img.shields.io/npm/l/@jswork/react-loading
[license-url]: https://github.com/afeiship/react-loading/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-loading
[size-url]: https://github.com/afeiship/react-loading/blob/master/dist/react-loading.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/react-loading
[download-url]: https://www.npmjs.com/package/@jswork/react-loading