Gathering detailed insights and metrics for react-spinners
Gathering detailed insights and metrics for react-spinners
Gathering detailed insights and metrics for react-spinners
Gathering detailed insights and metrics for react-spinners
A collection of loading spinner components for react
npm install react-spinners
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3,123 Stars
776 Commits
269 Forks
17 Watching
6 Branches
20 Contributors
Updated on 28 Nov 2024
Minified
Minified + Gzipped
TypeScript (88.35%)
JavaScript (6.28%)
Ruby (5.26%)
Shell (0.11%)
Cumulative downloads
Total Downloads
Last day
-23.9%
62,989
Compared to previous day
Last week
-4%
405,967
Compared to previous week
Last month
5.5%
1,754,834
Compared to previous month
Last year
22.1%
17,894,074
Compared to previous year
39
A collection of loading spinners with React.js based on Halogen.
This package is bootstraped using react-npm-boilerplate
With Yarn:
1yarn add react-spinners
With npm:
1npm install --save react-spinners
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
.
1import { useState, CSSProperties } from "react"; 2import ClipLoader from "react-spinners/ClipLoader"; 3 4const override: CSSProperties = { 5 display: "block", 6 margin: "0 auto", 7 borderColor: "red", 8}; 9 10function App() { 11 let [loading, setLoading] = useState(true); 12 let [color, setColor] = useState("#ffffff"); 13 14 return ( 15 <div className="sweet-loading"> 16 <button onClick={() => setLoading(!loading)}>Toggle Loader</button> 17 <input value={color} onChange={(input) => setColor(input.target.value)} placeholder="Color of the loader" /> 18 19 <ClipLoader 20 color={color} 21 loading={loading} 22 cssOverride={override} 23 size={150} 24 aria-label="Loading Spinner" 25 data-testid="loader" 26 /> 27 </div> 28 ); 29} 30 31export default App;
1import React from "react"; 2import ClipLoader from "react-spinners/ClipLoader"; 3 4const override: React.CSSProperties = { 5 display: "block", 6 margin: "0 auto", 7 borderColor: "red", 8}; 9 10class AwesomeComponent extends React.Component { 11 constructor(props) { 12 super(props); 13 this.state = { 14 loading: true, 15 }; 16 } 17 18 render() { 19 return ( 20 <div className="sweet-loading"> 21 <ClipLoader 22 cssOverride={override} 23 size={150} 24 color={"#123abc"} 25 loading={this.state.loading} 26 speedMultiplier={1.5} 27 aria-label="Loading Spinner" 28 data-testid="loader" 29 /> 30 </div> 31 ); 32 } 33}
Common default props for all loaders:
loading: true;
color: "#000000";
cssOverride: {}
speedMultiplier: 1;
All valid HTML props such as aria-*
and data-*
props are fully supported.
color
propcolor
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
cssOverride
propThe cssOverride
prop is an object of camelCase styles used to create inline styles on the loaders. Any html css property is valid here.
size
, height
, width
, and radius
propsThe input to these props can be number or string.
px
.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 |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
1 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More