CSS Loader & Spinner Generator

Loading spinners in pure CSS: ring, dots, bars or pulse, in your brand color. Each one is a few lines of HTML and CSS, with no GIF or JavaScript.

Loading Spinners vs Skeleton Screens vs Progress Bars: Which to Use When

Every interface waits sometimes: for a server response, a file upload, a page of search results. What you show during that wait changes how long it feels. The right loading indicator makes an app feel fast and trustworthy; the wrong one makes a two-second wait feel like ten. There are three main patterns, and each fits a different situation.

Loading spinner, skeleton screen and progress bar loading states compared

How long people will wait

Usability researcher Jakob Nielsen summarised three time limits in 1993, based on earlier work by Robert Miller, and they still hold up:

DurationHow it feelsWhat to show
Under 0.1 sInstantNothing; just show the result
0.1 – 1 sNoticeable delay, flow of thought stays intactUsually nothing, or a subtle state change
1 – 10 sUser’s attention starts to wanderA loading indicator
Over 10 sUsers want to do something elseA progress bar with an estimate, and the option to cancel or continue later

A common mistake is showing a spinner for waits under about 300 milliseconds. The spinner flashes on and off, which draws attention to the delay and makes the interface feel slower than showing nothing. A short delay before showing the indicator avoids the flash.

Pattern 1: spinners

A spinner (or any looping animation) says “something is happening” without saying how long it will take.

Use it for: short, unpredictable waits of roughly 1–4 seconds, like submitting a form, loading a small panel or refreshing a list.

Avoid it for: long waits, where an endless spinner makes users wonder if the app has frozen, and for loading entire pages of content, where a skeleton works better.

Pure CSS spinners are tiny, sharp at any size and easy to recolor. They animate only transform and opacity, which browsers can run on the compositor, so they keep spinning smoothly even when the main thread is busy. The CSS loader generator above creates ring, dots, bars and pulse loaders with a few lines of HTML and CSS.

Pattern 2: skeleton screens

A skeleton screen shows a grey outline of the layout that is about to load: blocks where images will be, bars where text will be. Facebook, LinkedIn and YouTube popularised the pattern in the mid-2010s.

Use it for: loading content into a known layout, such as feeds, cards, profiles, article pages and dashboards.

Why it works: users see the structure immediately, so the page feels like it’s already arriving. It also reduces layout shift, because content fills the space reserved by the skeleton instead of pushing things around.

Caveats: skeletons should match the real layout closely, or the jump when content arrives is jarring. They are not useful for actions like “saving”, where there is no layout to preview. A subtle shimmer animation can indicate activity, but keep it gentle and respect reduced-motion preferences.

Pattern 3: progress bars

A progress bar shows how much is done and, ideally, how much is left.

Use it for: long tasks where progress can be measured: file uploads, exports, installations, multi-step processing.

Determinate versus indeterminate: a determinate bar fills based on real progress; an indeterminate bar animates without a percentage. Use determinate whenever you can measure progress. Research on progress indicators has found that users prefer bars that speed up toward the end rather than slow down, so if you estimate, err toward finishing fast rather than getting stuck at 99%.

Spinner, skeleton or progress bar?

IndicatorBest wait lengthShows how long?Shows what’s coming?Typical use
NoneUnder ~0.3 sn/an/aFast interactions
Inline state change (“Saving…”)0.3 – 2 sNoNoButtons, toggles
Spinner1 – 4 sNoNoSmall panels, form submits
Skeleton screen0.5 – 5 sNoYes, the layoutFeeds, cards, page content
Progress barOver 4 sYesNoUploads, exports, processing

Perceived performance tricks

  • Optimistic UI: show the result immediately (a sent message, a liked post) and roll back only if the server reports an error.
  • Load progressively: show text first, then images. Use placeholders with the right aspect ratio so images don’t shift the layout; see our guide on placeholder images and layout shift.
  • Keep users busy: for long processes, let them keep working and notify them when the task is done.
  • Don’t block the whole page for one slow component; put the loader where the loading is.

Accessibility of loading states

Visual loaders mean nothing to screen reader users unless announced:

  • Give the loader role="status" (a polite live region) and an accessible name like aria-label="Loading search results".
  • When loading finishes, move focus or announce the result if the user triggered the action.
  • For regions that are updating, aria-busy="true" signals that content is in flux.
  • Respect prefers-reduced-motion: slow down or replace spinning animations with a static indicator or a gentle opacity pulse. WCAG 2.2.2 (Pause, Stop, Hide) also requires that moving content lasting more than five seconds can be paused, which matters for decorative looping animations.

Building a good CSS spinner

A few details separate a polished spinner from a distracting one:

  • Use your accent color for the moving part and a faint version of it for the track.
  • Keep it proportional: 16–24px inside buttons, 32–48px for panels.
  • Use a moderate speed, around 0.8–1.2 seconds per rotation. Fast spinners feel anxious.
  • Center it in the area that is loading, not in the middle of the whole screen.