Created
September 3, 2019 15:18
-
-
Save JoshK2/af3c43c2462f617c88ec87c159cd8d81 to your computer and use it in GitHub Desktop.
React spinner example - circle loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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