UseToolSuite UseToolSuite

CSS Loader Generator

Design custom CSS loading spinners and animations. Adjust speed, size, color, and thickness, then copy the pure CSS and HTML.

Live spinner preview Adjust size, speed, colour, thickness Pure CSS — no libraries Copy-ready HTML and CSS

Loader Properties


48px
5px
1s

#06B6D4
#E5E7EB

HTML & CSS

Code copied to clipboard!

Wiring the generated loader into a real app

The generated snippet is intentionally framework-free — one element plus a keyframe block — which makes integration mostly a question of where the CSS lives. In React/Vue/Svelte, paste the CSS into your global stylesheet (or a CSS module) and render the element conditionally: {isLoading && <span className="loader" />}. Add role="status" and aria-label="Loading" to the element so screen readers announce the wait instead of silence. One subtle bug to avoid: don’t unmount the loader the instant data arrives if that’s under ~200 ms after showing it — a spinner that flashes for two frames looks broken; either delay its appearance by 300 ms or guarantee it a minimum display time.

Customizing beyond the sliders

The generated keyframe is a starting point that takes well to small edits:

  • Easing — swap linear for cubic-bezier(0.6, 0.1, 0.4, 0.9) to get a spinner that accelerates through the bottom of its arc; subtle, but it reads as more refined.
  • Dual rings — duplicate the element, halve the size of the second, reverse its direction (animation-direction: reverse), and nest them for a classic two-ring loader.
  • Brand-colored track — instead of a gray track, use a 15–20% opacity version of your accent color (color-mix(in srgb, var(--accent) 18%, transparent)) so the loader stays on-brand in both themes.
  • Size by context — 16–20 px inline next to button text, 32–48 px for panel-level loads, larger only for full-page boots.

Why pure CSS beats GIFs and JS spinners

A CSS loader weighs a few hundred bytes against tens of kilobytes for a GIF, renders crisply at any DPI (GIFs alias on retina screens), inherits theme colors at runtime — one loader serves dark and light modes — and animates on the compositor thread, so it keeps spinning even while the main thread is busy doing the very work you’re waiting for. That last property is the practical one: a JavaScript-driven animation freezes exactly when the page blocks, displaying a frozen spinner at the moment users most need reassurance. The browser support story closed years ago; there is no remaining reason to ship image-based spinners.

CSS Loader Generator lets you design visually and copy production-ready CSS straight into your project. It's one of the free Color & CSS Tools on UseToolSuite. Below you'll find a step-by-step guide, answers to common questions, and related tools.

Last updated

How to Use This Tool

  1. 1

    Set the shape

    Choose the size, border thickness, and colours for your spinner.

  2. 2

    Tune the animation

    Adjust the speed and easing until the motion feels right in the preview.

  3. 3

    Copy the code

    Grab the HTML and CSS and drop them into your project — no dependencies needed.

How helpful was this tool?

Click to rate

Embed this tool on your site

Paste this snippet into any HTML page or blog post to embed a live, fully working copy of CSS Loader Generator. Free for any use.

Key Concepts

Essential terms and definitions related to CSS Loader Generator.

@keyframes

The CSS rule that defines the steps of an animation from 0% to 100% — for a spinner, usually just rotating from 0 to 360 degrees.

transform vs. layout properties

Animating transform and opacity is cheap and smooth; animating width, margin, or box-shadow forces the browser to redo layout each frame and causes stutter.

transform-origin

The point an element rotates or scales around. Centring it (50% 50%) keeps a spinner turning on the spot instead of wobbling.

Frequently Asked Questions

How do I keep the animation smooth?

Animate transform (rotate, scale) and opacity rather than properties like width or margin. Those two are the ones browsers can animate without redrawing the page, so the spin stays smooth even on phones.

Why does my spinner stutter?

Something in the animation is changing layout every frame — often an animated border-width, padding, or box-shadow. Switch to transform: scale() or rotate() for the motion and the stutter usually disappears.

Can a spinner do two things at once?

Yes — list two animations separated by a comma, e.g. spin and pulse together, and they run at the same time without conflict.

When should I show a spinner versus a skeleton screen or progress bar?

Match the indicator to wait length and knowledge: under ~300 ms, show nothing (a flashing spinner reads as jank); for short unknown waits (0.3–3 s), a spinner is right; for content layouts loading, skeleton screens feel faster because they promise structure; for long operations where progress is measurable (uploads, exports), only a real progress bar prevents abandonment. The spinner is the correct default for exactly one case — brief, indeterminate waits.

How do I make the loader respect prefers-reduced-motion?

Wrap a media query around the animation: inside @media (prefers-reduced-motion: reduce), set animation-duration to a much slower value or swap the spinner for a static 'Loading…' label. Vestibular-disorder users enable this OS setting because spinning motion can cause genuine dizziness — a loader is decorative, so it should be the first thing to yield.

Troubleshooting & Technical Tips

Common errors developers encounter and how to resolve them.

The spinner wobbles instead of turning cleanly

It is rotating around the wrong point. Add transform-origin: 50% 50% so it turns around its true centre.

Animation is janky on mobile

Avoid animating layout properties. Rebuild the effect using transform and opacity only, which the browser can handle without recalculating the page each frame.

Related Tools