CSS Loaders & Spinners

New

36 loading animations made with pure CSS. Pick a color, add a frame if you want one, then click any loader to copy its HTML and CSS. Every loader is one color, with no JavaScript, images or libraries.

Color
Gradient
48px
1×
Frame
Frame style
Preview
100%

How to add a CSS loader to your website

  1. Choose a color with the picker, type a hex code, or click a preset. Or pick a gradient: each loader then gets its own color, from the first color of the gradient on loader 01 to the last on loader 36.
  2. Optional: pick a frame (square, rounded or circle) and a frame style. The frame uses the same color, so the loader stays one color.
  3. Click a loader, then copy the HTML and the CSS. Put the CSS in your stylesheet and the HTML where the loader should appear.

Each loader is a single <span>. The atom adds two empty <i> elements inside it, the sliding squares one, and the loading text wraps each letter in an <i>. The shapes are drawn with borders, gradients, box shadows and the ::before and ::after pseudo-elements, so there is no extra markup and nothing to download. Class names and keyframe names are unique to each loader (.loader-ring, @keyframes loader-ring-a), so you can use several loaders on one page without clashes.

To come back to your settings later, bookmark the page or copy its address: the color, size, speed and frame are saved in the link.

Show and hide the preloader

A preloader is a loader you show while the page or some data is loading. The simplest way is to hide it when the work is done:

<div id="preloader">
  <span class="loader-ring" role="status" aria-label="Loading"></span>
</div>

<script>
  window.addEventListener('load', () => {
    document.getElementById('preloader').hidden = true;
  });
</script>

For a full-page preloader, give the wrapper position: fixed; inset: 0; display: grid; place-items: center; and a background color.

Frequently asked questions

Do these loaders need JavaScript?

No. Every animation is plain CSS with @keyframes. JavaScript is only needed to show or hide the loader at the right moment.

How do I change the size later?

Change font-size on the loader class. Every measurement inside the loader is in em, so the whole loader scales from that one value.

How do I change the color later?

Search the CSS for the hex code and replace it. Lighter parts of the loader use the same hex code with an alpha value added (for example #2563eb33), so replace those too.

Are the loaders accessible?

The copied HTML includes role="status" and aria-label="Loading", so screen readers announce it. For visitors who turn on reduced motion, you can slow the animation down:

@media (prefers-reduced-motion: reduce) {
  [class^="loader-"], [class^="loader-"] *,
  [class^="loader-"]::before, [class^="loader-"]::after {
    animation-duration: 3s !important;
  }
}

Which browsers are supported?

All current versions of Chrome, Edge, Firefox and Safari. A few loaders use newer CSS: the segment spinner, gears and synthwave sun use CSS masks; the synthwave sun, sand clock, pie timer, atom and DNA ladder animate a registered custom property (@property); the atom and DNA ladder use sin() and cos(); and the 3D orbiting dots use the translate and scale properties. All of these work in Chrome, Edge and Safari from 2023 and in Firefox 128 or later.

Can I use these loaders in commercial projects?

Yes. The code is free to use in personal and commercial projects, with no attribution needed.

Further reading

Last updated:

© 2008–2026 XORBIN.COM. All rights reserved.