<svg class="Loader " width="66px" height="66px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="Loader-path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
</svg>
<svg class="Loader {{modifier}}" width="66px" height="66px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="Loader-path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
</svg>
{
"id": null,
"modifier": null,
"style": null
}
import React from 'react';
const Loader = () => {
return (
<div style={{textAlign: 'center'}}>
<svg className="Loader" width="66px" height="66px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle
className="Loader-path"
fill="none"
strokeWidth="6"
strokeLinecap="round"
cx="33"
cy="33"
r="30"
/>
</svg>
</div>
);
};
export default Loader;
$offset: 180;
$duration: 1.4s;
.Loader {
animation: rotator $duration linear infinite;
&-path {
transform-origin: center;
animation: dash $duration ease-in-out infinite;
stroke: theme-color(primary);
stroke-dasharray: $offset;
stroke-dashoffset: 0;
}
@at-root {
@keyframes rotator {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(270deg);
}
}
@keyframes dash {
0% {
stroke-dashoffset: $offset;
}
50% {
transform: rotate(135deg);
stroke-dashoffset: $offset/4;
}
100% {
transform: rotate(450deg);
stroke-dashoffset: $offset;
}
}
}
}
The Loader component is a spinning circle used to indicate to users something is loading.