Skip to content

Instantly share code, notes, and snippets.

@JoshK2
Created September 3, 2019 15:18
Show Gist options
  • Save JoshK2/af3c43c2462f617c88ec87c159cd8d81 to your computer and use it in GitHub Desktop.
Save JoshK2/af3c43c2462f617c88ec87c159cd8d81 to your computer and use it in GitHub Desktop.
React spinner example - circle loader
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import './style.css'
export default class Circle extends Component {
render() {
const { color, size } = this.props;
return <div className="lds-circle" style={{ background: color, width: size, height: size }}></div>
}
}
Circle.propTypes = {
/** hex color */
color: PropTypes.string,
/** size in pixel */
size: PropTypes.number,
}
Circle.defaultProps = {
color: '#7f58af',
size: 64,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment