🎨CSS & Color

Pure CSS Loading Spinner

Lightweight animations for loading states without images.

Explanation

CSS animations are smoother and more performant than GIFs for loading indicators.

Examples

Circle Spinner
Output
animation: spin 1s linear infinite

Code Examples

CSS
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

Try it Now

💡 Tips

  • Add aria-hidden="true" to spinners
  • Use role="status" on the parent container
  • Keep animations smooth with linear timing

⚠️ Common Pitfalls

  • Spinners that are too fast can be distracting or cause motion sickness