🔄 Loader
Create a loading spinner to manage loading states across the app
Which CSS animation property will cause the spinner to rotate forever?
Build a Loading Spinner
// Loading Spinner
export default function Loader({ show }) {
return show ? <div className="loader"></div> : null;
}
globals.css
.loader {
border: 10px solid var(--color-bg);
border-top: 10px solid var(--color-blue);
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}