About this tool
CSS Loader Generator creates a loading spinner in pure CSS. Choose a style (ring, dots or bars), set the colour, the size from 16 to 120 pixels and the animation duration from 0.3 to 3 seconds, and the preview animates live while the code updates.
The copied output is the @keyframes rule plus the class CSS: uw-spin for the ring, uw-bounce for the three dots and uw-stretch for the four bars. The markup is not part of the copied text, so you add it yourself: a single div with class uw-ring, a div with class uw-dots holding three spans, or a div with class uw-bars holding four spans. The ring is a bordered circle with a faint track (the colour at about 20 percent opacity) and a solid top edge that rotates. Border thickness, dot size and bar width scale with the size you choose, with sensible minimums.
There is no JavaScript and no image, so the loader works wherever the CSS does. The generated code does not include a prefers-reduced-motion rule, so add one if you want to respect that setting. Colours are output as hex codes. All code is generated in your browser.