CSS loader generator — accessible spinners, dots and progress bars

Choose a spinner ring, bouncing dots, bars, a pulse, a ripple, an orbit or an indeterminate progress bar, set its size, colour and cycle time, and copy CSS and HTML that also tell screen readers something is loading.

Live demo · real result from this tool

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the CSS loader generator

  1. Pick a Loader: Spinner ring, Dual ring, Bouncing dots, Bars, Pulse, Ripple, Indeterminate bar or Orbit.
  2. Set the Size from 16 to 160 px.
  3. Choose a Colour and a Cycle time between 0.3 and 4 seconds.
  4. Copy both outputs: the CSS into your stylesheet and the HTML where the loader should appear.

What it does and when to use it

A loading indicator tells people the page has not frozen. This tool gives you a small, self-contained one: a .loader element, its keyframes, and a .visually-hidden helper class. Use it while a search runs, a form submits or a chart fetches data.

To change the speed curve of a loader, design one in the cubic-bezier editor. For other looping motion such as a pulsing badge, use the CSS animation generator, and if you prefer an SVG spinner, try the SVG spinner generator.

How it works

Each style is built from borders, small circles or bars:

  • Ring and dual ring spin one element with coloured top (and bottom) borders. The border thickness is one eighth of the size, at least 2 px.
  • Dots and bars animate child spans with staggered delays so they move in a wave.
  • Pulse and ripple grow circles from nothing while fading them out.
  • Indeterminate bar slides a 40% segment across a track four times as wide as the size.
  • Orbit rotates two dots on opposite sides of a circle.

The ring and the indeterminate bar draw their faint track with color-mix(in srgb, <colour> 20%, transparent). MDN lists color-mix() as Baseline widely available since May 2023 and @keyframes since September 2015.

Worked examples

Default spinner ring, 48 px, #4f46e5, 1 s:

.loader {
  width: 48px; height: 48px;
  border: 6px solid color-mix(in srgb, #4f46e5 20%, transparent);
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
}

Bars at 1.2 s. The four bars start 0.12 s apart, ending with .loader span:nth-child(4) { animation-delay: 0.36s; }.

A slim page-top bar. Indeterminate bar at size 32 gives width: 128px; height: 4px;. Set the width to 100% in your CSS to span the page.

Limits and tips

  • The class names are fixed (.loader, .visually-hidden, loader-spin and so on). Rename them if they clash with your stylesheet.
  • Show the loader only after a short pause. A spinner that flashes for a split second on fast responses looks like a glitch.
  • Do not leave it spinning on errors. Replace it with a message that explains what went wrong.

Frequently asked questions

Do these loaders need JavaScript or images?
No. Each one is a few elements animated with CSS @keyframes, so there is nothing extra to download. You still need your own script to show the loader while data loads and remove it afterwards.
Why does the HTML include role="status" and hidden text?
A spinning shape means nothing to a screen reader. role="status" marks the loader as a polite live region, and the visually hidden "Loading…" text gives it words to announce, while staying invisible on screen.
What does Cycle time change?
The length of one animation loop in seconds. For dots and bars, the delays between the parts scale with it, so the rhythm stays the same at any speed.
What about people who turn off animations?
The CSS ends with a prefers-reduced-motion media query that slows the loader to at least a 2-second cycle (three times the chosen cycle time), so it still shows activity without fast spinning.
Which loader should I use?
Rings and dots suit short waits inside buttons or cards. The indeterminate bar fits the top of a page or panel. If you know how far along a task is, a real progress bar with a percentage is more helpful than any looping animation.

Sources

  1. @keyframes - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  2. color-mix() - CSS | MDN — MDN Web Docs, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close