Home / Free downloads / 12 Pure CSS Loaders

12 Pure CSS Loaders: copy, paste, done

Twelve loading animations in one small stylesheet. They use no images and no JavaScript. Each loader takes the text colour around it and scales with a single variable.

How to use it

1. Add the stylesheet

<link rel="stylesheet" href="loaders.css">

2. Paste a loader

In the demo above, click any loader to copy its HTML. Most are a single element.

<span class="ldr ldr-ring"></span>

3. Set colour and size

A loader uses the current text colour. The size comes from --ldr-size.

<span class="ldr ldr-ring" style="color: #7c5cff; --ldr-size: 64px"></span>

The twelve loaders

ClassLooks likeInner elements
ldr-ringClassic spinning ringnone
ldr-dualTwo rings turning in opposite directionsnone
ldr-arcA ring with a soft fading tailnone
ldr-dotsThree pulsing dotsthree <i>
ldr-waveFive dots jumping in a wavefive <i>
ldr-barsFour equalizer barsfour <i>
ldr-pulseA dot sending out a pulsenone
ldr-rippleTwo expanding ringsnone
ldr-orbitA glowing dot circling a ringnone
ldr-flipA square flipping overnone
ldr-gridNine squares fading in a diagonal wavenine <i>
ldr-progressA progress bar with no known endnone

Change the speed

<span class="ldr ldr-dots" style="--ldr-speed: .6s"><i></i><i></i><i></i></span>

Put a loader inside a button

Because a loader takes the text colour, it fits into a button without extra CSS.

<button disabled>
  <span class="ldr ldr-ring" style="--ldr-size: 1em"></span> Saving...
</button>

Full-page loading screen

<div style="position:fixed; inset:0; display:grid; place-items:center; background:#fff; color:#7c5cff">
  <span class="ldr ldr-ripple" style="--ldr-size: 72px"></span>
</div>

Accessibility

A spinner is only a picture. Tell screen readers what is happening by adding a role and a label.

<span class="ldr ldr-ring" role="status" aria-label="Loading"></span>

Visitors with reduced motion switched on get a much slower animation instead of a fast spin.

What is in the download

  • loaders.css all twelve loaders, about 5 KB
  • index.html and demo.css the demo page you see above
  • README.txt and LICENSE.txt the short guide and the MIT licence

Licence

MIT licence. Use it in personal and commercial projects, change it as you like. A link back is welcome and not required.