Dev Helpers
← Back

Animate a loading indicator

Animate a loading indicator with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  .demo {
    display: inline-block;
    animation: spin 1s linear infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    .demo {
      animation: none;
    }
  }
</style>
<span class="demo" aria-label="Loading">◌</span>