react-loading-spinkit

page loading component

Usage no npm install needed!

<script type="module">
  import reactLoadingSpinkit from 'https://cdn.skypack.dev/react-loading-spinkit';
</script>

README

react-loading-spinkit

npm version

this component base on react-spinkit, but more convenient

Required Knowledge

must add css-loader and style-loader in webpack config file, you can look this file

Installation

npm install --save react-loading-spinkit

Usage

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Loading from 'react-loading-spinkit';

class App extends Component {
  render() {
    return (
      <div style={{ height: '100vh', width: '100vw' }}>
        <Loading show={true} />
      </div>
    );
  }
}

ReactDOM.render(
  <App />,
  document.querySelector('.app'),
);

Props

Name Type Default Description
className string add a custom classname to the outer div
color string '#5282ef' programmatically set the color of the spinners; this can either be a hex value or a color word.
fadeIn string set the time before the spinner fades in.
height union: string
 number
'100%' loading overlay's height
name string specify spinner to use (defaults to line-scale-pulse-out-rapid).
overrideSpinnerClassName string change the default sk-spinner className.
show bool false control loading show status
width union: string
 number
'100%' loading overlay's width