🎉Welcome to Bit Cloud's new home!Start freeor check out our newcommunity site

default

v1.2.1arrow_drop_down
v1.2.1
v1.1.8
v1.1.7
v1.1.4
v1.1.2
v1.1.0
v1.0.8
v1.0.7
v1.0.5
v1.0.4
v1.0.3
STATUS
Passing
DOWNLOADS
634
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
2 years ago
SIZE
2 KB
simple react spinner
1 contributor
Install default as a package?
Copied
npm i @bit/joshk.react-spinners-css.default
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
index.js
34 Lines(26 sloc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import styles from './style.module.css'

export default function Default({ color, className, style, size }) {
  const circles = [...Array(12)].map((_, index) => (
    <div key={index} style={{ background: `${color}`, width: size * 0.075, height: size * 0.075 }} />
  ))

  return (
    <div className={classNames(styles['lds-default'], className)} style={{ height: size, width: size, ...style }}>
      {circles}
    </div>
  )
}

Default.propTypes = {
  /** hex color */
  color: PropTypes.string,
  /** size in pixel */
  size: PropTypes.number,
  /** class name  */
  className: PropTypes.string,
  /** style object */
  style: PropTypes.object,
}

Default.defaultProps = {
  color: '#7f58af',
  size: 80,
  className: '',
  style: {},
}
Help and resources