CSS Loader & Spinner Generator
Pick from 10 pure-CSS loading animations — ring, dots, bars, pulse, ripple and more — then customise the color, size, and speed. Preview live on light or dark backgrounds and copy ready-to-paste HTML and CSS. No images, no JavaScript.
Choose a Loader
Customise
HTML
CSS
Pure-CSS Loading Spinners: A Complete Guide
A loading indicator reassures users that something is happening while content, images, or data are on the way. The best loaders are lightweight, accessible, and match your brand — and you don't need a GIF, an SVG file, or a JavaScript library to build one. Modern CSS animations can produce smooth, GPU-accelerated spinners from a single element.
Why CSS Loaders Beat GIFs and JavaScript
- Zero extra requests — the loader ships inside your CSS, so there's no image to download (which is ironic for a "loading" graphic that itself has to load).
- Crisp at any size and DPI — CSS shapes are vector-sharp on retina screens; raster GIFs blur when scaled.
- Recolour instantly — one custom property changes the whole spinner to match light or dark mode.
- GPU-accelerated — animating
transformandopacitykeeps loaders silky without pegging the CPU.
How the Common Patterns Work
- Ring spinner — a circle with a transparent track and one coloured side, rotated forever with
@keyframesspinningtransform: rotate(360deg). - Bouncing dots — several small circles sharing one keyframe, each offset with a staggered
animation-delayso the motion ripples across them. - Scaling bars — vertical bars animating
transform: scaleY()with delays, like an audio equaliser. - Pulse & ripple — circles animating
scaleandopacityoutward to suggest expanding waves.
Make Your Loader Accessible
A spinner is decorative, so hide it from assistive tech with aria-hidden="true" and announce status separately using a live region — for example a visually-hidden element with role="status" containing the text "Loading…". This way screen-reader users hear meaningful feedback instead of a silent animation. Also honour prefers-reduced-motion: wrap the animation in a media query so users who get motion sickness see a static or gentler indicator.
Performance Tips
Stick to animating transform and opacity — both are composited on the GPU and never trigger expensive layout or paint. Avoid animating width, height, top, or margin, which force reflow every frame. Keep loaders small and remove them from the DOM once content arrives so their animation loop stops consuming resources.
Frequently Asked Questions
@keyframes animations. Paste the markup and styles into your project and the spinner runs on its own — no scripts, no libraries, no image files.aria-hidden="true" and announce loading status with a separate role="status" live region containing text like "Loading…". Also respect prefers-reduced-motion for users sensitive to animation.transform and opacity — both are GPU-composited and very cheap. These loaders are built that way. Just remember to remove the loader from the page once your content has loaded.