Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/react-spinner
Spinner for react.
https://github.com/afeiship/react-spinner
react spinner
Last synced: 24 days ago
JSON representation
Spinner for react.
- Host: GitHub
- URL: https://github.com/afeiship/react-spinner
- Owner: afeiship
- License: mit
- Created: 2019-11-25T10:06:32.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-06T03:10:07.000Z (almost 4 years ago)
- Last Synced: 2024-12-10T10:30:18.784Z (28 days ago)
- Topics: react, spinner
- Language: JavaScript
- Size: 358 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-spinner
> Spinner 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-spinner
```## properties
| Name | Type | Required | Default | Description |
| --------- | ------- | -------- | --------- | ------------------------------------- |
| className | string | false | - | The extended className for component. |
| value | bool | false | false | The spinner visible value. |
| indicator | element | false | - | The indicator element. |
| caption | any | false | 'loading' | The indicator text. |## usage
1. import css
```scss
@import "~@jswork/react-spinner/dist/style.css";// or use sass
@import "~@jswork/react-spinner/dist/style.scss";// customize your styles:
$react-spinner-options: ()
```
2. import js
```js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactSpinner from '@jswork/react-spinner';
import './assets/style.scss';import musicSvg from './assets/music-1080px.svg';
import wedgesSvg from './assets/wedges-2.9s-108px.svg';class App extends React.Component {
constructor(inProps) {
super(inProps);
this.state = {
loading: false,
svg: musicSvg
};
}handleClick1 = (inEvent) => {
const { loading } = this.state;
this.setState({ loading: !loading, svg: musicSvg });
};handleClick2 = (inEvent) => {
const { loading } = this.state;
this.setState({ loading: !loading, svg: wedgesSvg });
};render() {
const { loading, svg } = this.state;return (
Toggle Loading - Music
Toggle Loading - WedgesSvg
}>
);
}
}ReactDOM.render(, document.getElementById('app'));
```
## documentation
- https://afeiship.github.io/react-spinner/## license
Code released under [the MIT license](https://github.com/afeiship/react-spinner/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/react-spinner
[version-url]: https://npmjs.org/package/@jswork/react-spinner[license-image]: https://img.shields.io/npm/l/@jswork/react-spinner
[license-url]: https://github.com/afeiship/react-spinner/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-spinner
[size-url]: https://github.com/afeiship/react-spinner/blob/master/dist/react-spinner.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/react-spinner
[download-url]: https://www.npmjs.com/package/@jswork/react-spinner