All Projects → davidhu2000 → React Spinners

davidhu2000 / React Spinners

Licence: mit
A collection of loading spinner components for react

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Spinners

spinners-angular
Lightweight SVG/CSS spinners for Angular
Stars: ✭ 21 (-98.98%)
Mutual labels:  loader, spinners, loading-spinners
react-awesome-loaders
🚀 High quality, super responsive and completely customisable Loading Animations to insert into your website with single line of code.
Stars: ✭ 146 (-92.89%)
Mutual labels:  loader, spinners, react-spinners
Alive Progress
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
Stars: ✭ 2,940 (+43.14%)
Mutual labels:  progressbar, spinners
Spinners React
Lightweight SVG/CSS spinners for React
Stars: ✭ 254 (-87.63%)
Mutual labels:  loader, spinners
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (-87.83%)
Mutual labels:  react-component, progressbar
React Spinners Kit
A collection of loading spinners with React.js
Stars: ✭ 158 (-92.31%)
Mutual labels:  progressbar, spinners
React Sweet Progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 239 (-88.36%)
Mutual labels:  react-component, progressbar
Rsup Progress
❤️ A simple progress bar with promises support
Stars: ✭ 290 (-85.88%)
Mutual labels:  loader, progressbar
Progress bar
Command-line progress bars and spinners for Elixir.
Stars: ✭ 281 (-86.32%)
Mutual labels:  progressbar, spinners
Vue Spinners
💫 A collection of loading spinner components for Vuejs
Stars: ✭ 255 (-87.59%)
Mutual labels:  loader, spinners
Whirl
CSS loading animations with minimal effort!
Stars: ✭ 774 (-62.32%)
Mutual labels:  loader, spinners
React Loader Spinner
Collection set of react-spinner for async operation
Stars: ✭ 378 (-81.6%)
Mutual labels:  react-component, loader
Aframe Preloader Component
A preloading bar that automatically displays while scene assets load.
Stars: ✭ 27 (-98.69%)
Mutual labels:  loader, spinners
Robojs
RoboJS is a library that aims to dynamically load JS modules depending on how the DOM is composed.
Stars: ✭ 133 (-93.52%)
Mutual labels:  loader
Axui Datagrid
DataGrid, DataSheet for React
Stars: ✭ 138 (-93.28%)
Mutual labels:  react-component
Progressbar
A really basic thread-safe progress bar for Golang applications
Stars: ✭ 2,212 (+7.69%)
Mutual labels:  progressbar
Progress
基于Vue 2.x 的进度条,支持直线和环形(顺时针和逆时针)。Vue-based progress component, support line and circle(clockwise or couterclockwise).
Stars: ✭ 130 (-93.67%)
Mutual labels:  progressbar
Kea
Production Ready State Management for React
Stars: ✭ 1,805 (-12.12%)
Mutual labels:  react-component
Webpackbar
Elegant ProgressBar and Profiler for Webpack 3 , 4 and 5
Stars: ✭ 1,887 (-8.13%)
Mutual labels:  progressbar
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (-4.48%)
Mutual labels:  react-component

React Spinners

npm version circle ci downloads license Coverage Status

dependencies Status devDependencies Status peerDependencies Status

A collection of loading spinners with React.js based on Halogen.

This package is bootstraped using react-npm-boilerplate

Demo

Demo Page

Installation

With Yarn:

yarn add react-spinners

With npm:

npm install --save react-spinners

Usage

Each loader has their own default properties. You can overwrite the defaults by passing props into the loaders.

Each loader accepts a loading prop as a boolean. The loader will render null if loading is false.

IMPORTANT: This package uses emotion. Remember to add the plugin to .babelrc, for example:

{
    "presets": ["@babel/preset-react", "@babel/preset-env"],
    "plugins": ["@emotion"]
}

Example

import { useState } from "react";
import { css } from "@emotion/react";
import ClipLoader from "react-spinners/ClipLoader";

// Can be a string as well. Need to ensure each key-value pair ends with ;
const override = css`
  display: block;
  margin: 0 auto;
  border-color: red;
`;

function App() {
  let [loading, setLoading] = useState(true);
  let [color, setColor] = useState("#ffffff");

  return (
    <div className="sweet-loading">
      <button onClick={() => setLoading(!loading)}>Toggle Loader</button>
      <input value={color} onChange={(input) => setColor(input.target.value)} placeholder="Color of the loader" />

      <ClipLoader color={color} loading={loading} css={override} size={150} />
    </div>
  );
}

export default App;
Example using React Class
import React from "react";
import { css } from "@emotion/react";
import ClipLoader from "react-spinners/ClipLoader";

// Can be a string as well. Need to ensure each key-value pair ends with ;
const override = css`
  display: block;
  margin: 0 auto;
  border-color: red;
`;

class AwesomeComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      loading: true
    };
  }

  render() {
    return (
      <div className="sweet-loading">
        <ClipLoader css={override} size={150} color={"#123abc"} loading={this.state.loading} speedMultiplier={1.5} />
      </div>
    );
  }
}

Available Loaders, PropTypes, and Default Values

Common default props for all loaders:

loading: true;
color: "#000000";
css: "";
speedMultiplier: 1;

color prop

color prop accepts a color hash in the format of #XXXXXX or #XXX. It also accepts basic colors listed below:

maroon, red, orange, yellow, olive, green, purple, white, fuchsia, lime, teal, aqua, blue, navy, black, gray, silver

css prop

css works exactly like the css works with the emotion package. You can directly write your css in css syntax without the dirty camelCase css in jss syntax. We recommend you to use this awesome library in your project. It supports Server side rendering with HTTP2 Stream! More info about using css here

size, height, width, and radius props

The input to these props can be number or string.

  • If value is number, the loader will default to css unit px.
  • If value is string, the loader will verify the unit against valid css units.
    • If unit is valid, return the original value
    • If unit is invalid, output warning console log and default to px.

The table below has the default values for each loader.

Loader size height width radius margin
BarLoader 4 100
BeatLoader 15 2
BounceLoader 60
CircleLoader 50
ClimbingBoxLoader 15
ClipLoader 35
ClockLoader 50
DotLoader 60 2
FadeLoader 15 5 2 2
GridLoader 15
HashLoader 50 2
MoonLoader 60 2
PacmanLoader 25 2
PropagateLoader 15
PuffLoader 60
PulseLoader 15 2
RingLoader 60 2
RiseLoader 15 2
RotateLoader 15 2
ScaleLoader 35 4 2 2
SyncLoader 15 2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].