css loading animation

How to use the css loading animation

  1. Pick a loader style: spinner, dots, bars, pulse, progress, skeleton.
  2. Adjust size, color, and speed.
  3. The output is a single element with @keyframes — no SVG or JavaScript required.
  4. Copy the HTML + CSS snippet.

When to use it

Use CSS loaders for 200ms-2s waits — form submits, page transitions, small async loads. For longer waits (>2s), show progress explicitly rather than an indeterminate spinner. Use skeleton screens for content that has predictable shape. Alternative: loading.io has more variations but ships SVG; CSS loaders ship zero bytes.

Frequently asked questions

How do I show a loader only when the request takes >300ms?
Start a setTimeout(showLoader, 300) when the request begins and clearTimeout when it resolves. Prevents flicker for fast responses.
Are spinners accessible?
Add aria-busy="true" on the container and role="status" with an aria-label (e.g., "Loading") on the spinner. Screen readers announce the loading state.
Can I use these without CSS @keyframes support?
No — these are CSS-only animations. For older browsers, ship a static fallback SVG.

Related generators

Last updated: 2026-04-23