🔄 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

file_type_js components/Loader.js
// Loading Spinner
export default function Loader({ show }) {
  return show ? <div className="loader"></div> : null;
}
file_type_css 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); }
}

Questions? Let's chat

Open Discord