Created
December 12, 2020 21:30
-
-
Save guyb7/a07e186b2961712a72cc77263062ea1b to your computer and use it in GitHub Desktop.
Simple react spinner with styled components
This file contains hidden or 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 styled, { keyframes } from 'styled-components' | |
| const rotate = keyframes` | |
| from { | |
| transform: rotate(0deg); | |
| } | |
| to { | |
| transform: rotate(359deg); | |
| } | |
| ` | |
| const Spinner = styled.div` | |
| width: 16px; | |
| height: 16px; | |
| clear: both; | |
| margin: 20px auto; | |
| border: 2px rgba(0, 0, 0, 0.25) solid; | |
| border-top: 2px rgba(0, 0, 0, 1) solid; | |
| border-radius: 50%; | |
| -webkit-animation: ${rotate} .6s infinite linear; | |
| animation: ${rotate} .6s infinite linear; | |
| ` | |
| export default Spinner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment