Created
January 11, 2018 14:59
-
-
Save dmitrizzle/5883ca1f72f34398155eb2bc1d0ccfc6 to your computer and use it in GitHub Desktop.
A components for displaying "loading" dots with CSS (for ReactJS and Styled Components)
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
// tools | |
import React from "react" | |
import styled from "styled-components" | |
// styles | |
const Dots = styled.span` | |
&::after { | |
display: inline-block; | |
animation: ellipsis 1.25s infinite; | |
content: "."; | |
width: 1em; | |
text-align: left; | |
} | |
@keyframes ellipsis { | |
0% { | |
content: "."; | |
} | |
33% { | |
content: ".."; | |
} | |
66% { | |
content: "..."; | |
} | |
} | |
` | |
// return | |
export default props => { | |
return <Dots>{props.children}</Dots> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<3