To create loader , take a div with classname spinner
import './App.css'
function App() {
return (
<div className="spinner"></div>
);
}
export default App;
In the index.css or App.css :
.spinner{
width: 30px;
height: 30px;
border: 8px solid #f3f3f3;
border-top: 8px solid red;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin{
from {
transform: rotate(0deg);
}
to{
transform: rotate(360deg);
/* add if you want color change */
border-top: 8px solid blue;
}
}
Comments
Post a Comment