Free ToolsGuidesCase StudiesResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call
Playground~/frontend Open editor

~/css/loaders

23 CSS Loaders

21 Pure CSS2 with JSPublished 2026-10-03Free · no sign-up

Loading animations for every kind of wait, now with the full spinner and skeleton screen collections on the same page. Loading animations for every kind of wait: a spinner for short pauses, a skeleton for content that is on its way, a progress bar for page loads and a progress ring when you know the percentage. Each one tells screen readers that something is loading, and slows down or stops for visitors who prefer reduced motion.

01. Ring Spinner

Pure CSS

The classic loading ring: a faint full circle with one bright arc spinning around it. It is a single element with role=status and a visually hidden label, so screen readers announce 'Loading' instead of nothing. Change the size with one variable.

View code
<div class="ttl-ring" role="status"><span class="ttl-sr">Loading</span></div>
.ttl-ring {
  --size: 44px;
  width: var(--size);
  height: var(--size);
  border: 4px solid rgba(125, 163, 255, .2);
  border-top-color: #7DA3FF;
  border-radius: 50%;
  animation: ttl-spin .8s linear infinite;
}
.ttl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes ttl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ttl-ring { animation-duration: 2.4s; } }

02. Bouncing Dots

Pure CSS

Three dots that rise and fall one after another, the loader people read as 'someone is typing'. Each dot runs the same keyframes with a staggered delay, and the bounce uses transform so it never triggers layout. Fits inside chat bubbles and buttons.

View code
<div class="ttl-dots" role="status" aria-label="Loading">
  <span></span><span></span><span></span>
</div>
.ttl-dots { display: inline-flex; gap: 8px; }
.ttl-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7DA3FF;
  animation: ttl-bounce 1s ease-in-out infinite;
}
.ttl-dots span:nth-child(2) { animation-delay: .15s; }
.ttl-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ttl-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-12px); opacity: 1; }
}
@keyframes ttl-fade { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .ttl-dots span { animation: ttl-fade 1.4s ease-in-out infinite; }
}

03. Skeleton Loading Card

Pure CSS

A placeholder that has the shape of the content that is coming: avatar, two text lines and a block, with a soft shimmer passing over them. Skeletons make waiting feel shorter than a spinner and stop the page jumping when the real content arrives, as long as they match its size.

View code
<div class="ttl-skel" role="status" aria-label="Loading content">
  <div class="ttl-skel-row">
    <span class="ttl-skel-av"></span>
    <div class="ttl-skel-lines"><span></span><span></span></div>
  </div>
  <span class="ttl-skel-block"></span>
</div>
.ttl-skel {
  width: 300px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: #121722;
}
.ttl-skel-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.ttl-skel-lines { flex: 1; display: grid; gap: 8px; }
.ttl-skel span {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #1b2232 0%, #262f44 40%, #1b2232 80%);
  background-size: 300% 100%;
  animation: ttl-shimmer 1.4s ease-in-out infinite;
}
.ttl-skel .ttl-skel-av { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; }
.ttl-skel-lines span { height: 11px; }
.ttl-skel-lines span:last-child { width: 60%; }
.ttl-skel-block { height: 90px; }
@keyframes ttl-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ttl-skel span { animation: none; } }

04. Indeterminate Progress Bar

Pure CSS

A thin bar for page or upload loading when you do not know how long it will take. A highlight slides across the track on a loop. It uses the native progress element with no value, which browsers already expose as busy, and only restyles it.

View code
<progress class="ttl-bar" aria-label="Loading"></progress>
.ttl-bar {
  appearance: none;
  -webkit-appearance: none;
  width: 280px;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(125, 163, 255, .15) linear-gradient(90deg, transparent, #7DA3FF, #5B8CFF, transparent) no-repeat;
  background-size: 40% 100%;
  animation: ttl-slide 1.2s ease-in-out infinite;
}
.ttl-bar::-webkit-progress-bar { background: transparent; }
.ttl-bar::-moz-progress-bar { background: transparent; }
@keyframes ttl-slide {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}
@media (prefers-reduced-motion: reduce) { .ttl-bar { animation-duration: 3s; } }

05. Pulse Ring

Pure CSS

A solid dot with rings that grow and fade outward, like a radar ping. It works as a loader, a 'live' indicator or a hotspot marker on a product image. Two pseudo-elements with offset delays make the rings, so the markup is one element.

View code
<span class="ttl-pulse" role="status" aria-label="Live"></span>
.ttl-pulse {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5B8CFF;
}
.ttl-pulse::before,
.ttl-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #7DA3FF;
  animation: ttl-ping 1.8s cubic-bezier(.2,.6,.3,1) infinite;
}
.ttl-pulse::after { animation-delay: .9s; }
@keyframes ttl-ping {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ttl-pulse::before, .ttl-pulse::after { animation: none; opacity: 0; } }

06. Equalizer Bars

Pure CSS

Five bars that rise and fall like an audio equalizer. It suits media players, voice notes and anything to do with sound. Each bar scales from the bottom with transform-origin, so the motion stays smooth and the overall size never changes.

View code
<div class="ttl-eq" role="status" aria-label="Loading">
  <span></span><span></span><span></span><span></span><span></span>
</div>
.ttl-eq { display: inline-flex; align-items: flex-end; gap: 5px; height: 40px; }
.ttl-eq span {
  width: 6px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(#7DA3FF, #5B8CFF);
  transform-origin: bottom;
  animation: ttl-eq 1s ease-in-out infinite;
}
.ttl-eq span:nth-child(2) { animation-delay: -.8s; }
.ttl-eq span:nth-child(3) { animation-delay: -.6s; }
.ttl-eq span:nth-child(4) { animation-delay: -.4s; }
.ttl-eq span:nth-child(5) { animation-delay: -.2s; }
@keyframes ttl-eq {
  0%, 100% { transform: scaleY(.25); }
  50% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) { .ttl-eq span { animation-duration: 3s; } }

07. Progress Ring with Percentage

CSS + JS

A circular progress indicator with the percentage in the middle, for uploads and multi-step tasks where you know how far along you are. The ring is an SVG circle whose stroke-dashoffset follows the value, and the element exposes role=progressbar with aria-valuenow so assistive tech reads the number.

View code
<div class="ttl-pr" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-label="Upload progress">
  <svg viewBox="0 0 120 120" aria-hidden="true">
    <circle class="ttl-pr-track" cx="60" cy="60" r="52"/>
    <circle class="ttl-pr-fill" cx="60" cy="60" r="52"/>
  </svg>
  <span class="ttl-pr-num">0%</span>
</div>
.ttl-pr { position: relative; width: 120px; height: 120px; }
.ttl-pr svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ttl-pr circle { fill: none; stroke-width: 10; }
.ttl-pr-track { stroke: rgba(125, 163, 255, .15); }
.ttl-pr-fill {
  stroke: #7DA3FF;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset .3s ease;
}
.ttl-pr-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #F5F7FA;
  font: 800 24px Inter, system-ui, sans-serif;
}
document.querySelectorAll('.ttl-pr').forEach(function (el) {
  var fill = el.querySelector('.ttl-pr-fill');
  var num = el.querySelector('.ttl-pr-num');
  var full = 2 * Math.PI * 52;
  var value = 0;
  function set(v) {
    fill.style.strokeDashoffset = full * (1 - v / 100);
    num.textContent = v + '%';
    el.setAttribute('aria-valuenow', v);
  }
  setInterval(function () {
    value = value >= 100 ? 0 : Math.min(100, value + 7);
    set(value);
  }, 400);
});

08. Orbit Loader

Pure CSS

Two small planets orbiting a centre point at different speeds and in opposite directions. It is a decorative loader for splash screens and empty states where a little personality fits. Each orbit is a rotating ring with a dot placed on its edge.

View code
<div class="ttl-orbit" role="status" aria-label="Loading">
  <span class="ttl-orbit-core"></span>
  <span class="ttl-orbit-a"></span>
  <span class="ttl-orbit-b"></span>
</div>
.ttl-orbit { position: relative; width: 80px; height: 80px; }
.ttl-orbit > span { position: absolute; border-radius: 50%; }
.ttl-orbit-core {
  inset: 32px;
  background: linear-gradient(135deg, #7DA3FF, #5B8CFF);
  box-shadow: 0 0 18px rgba(125, 163, 255, .7);
}
.ttl-orbit-a, .ttl-orbit-b { border: 1px dashed rgba(125, 163, 255, .25); }
.ttl-orbit-a { inset: 14px; animation: ttl-spin 1.6s linear infinite; }
.ttl-orbit-b { inset: 0; animation: ttl-spin 2.6s linear infinite reverse; }
.ttl-orbit-a::after, .ttl-orbit-b::after {
  content: "";
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #8B5CF6;
}
.ttl-orbit-b::after { background: #22d3ee; width: 8px; height: 8px; top: -4px; margin-left: -4px; }
@keyframes ttl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ttl-orbit-a, .ttl-orbit-b { animation-duration: 6s; } }

09. Dual Ring Spinner

SpinnerRing

Two arcs spin in opposite directions, one inside the other, made from borders with two transparent sides. The wrapper has role="status" with a visually hidden Loading label, which is what every spinner needs.

View code
<div class="sp1" role="status"><span class="sr">Loading</span></div>
.sp1 { position: relative; width: 56px; height: 56px; }
.sp1::before, .sp1::after { content: ""; position: absolute; border-radius: 50%; border: 4px solid transparent; }
.sp1::before { inset: 0; border-top-color: #38bdf8; border-right-color: #38bdf8; animation: sp1 1s linear infinite; }
.sp1::after { inset: 10px; border-bottom-color: #f472b6; border-left-color: #f472b6; animation: sp1 .8s linear infinite reverse; }
.sp1 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp1 { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp1::before, .sp1::after { animation-duration: 3s; } }

10. Segmented Fading Spinner

SpinnerSegments

Twelve short bars arranged in a circle fade in sequence, the classic system activity indicator. Each bar is rotated into place with a custom property and shares one fade animation offset by a twelfth of the cycle.

View code
<div class="sp2" role="status"><span class="sr">Loading</span><i style="--i:0"></i><i style="--i:1"></i><i style="--i:2"></i><i style="--i:3"></i><i style="--i:4"></i><i style="--i:5"></i><i style="--i:6"></i><i style="--i:7"></i><i style="--i:8"></i><i style="--i:9"></i><i style="--i:10"></i><i style="--i:11"></i></div>
.sp2 { position: relative; width: 48px; height: 48px; }
.sp2 i { position: absolute; left: 22px; top: 2px; width: 4px; height: 12px; border-radius: 2px; background: #344054; transform-origin: 2px 22px; transform: rotate(calc(var(--i) * 30deg)); animation: sp2 1.2s linear infinite; animation-delay: calc(var(--i) * .1s - 1.2s); }
.sp2 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp2 { from { opacity: 1; } to { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .sp2 i { animation-duration: 3.6s; } }

11. Gradient Arc Spinner

SpinnerConic

A ring that fades from transparent to solid around its length, so it looks like a comet chasing its own tail. The colour is a conic gradient and the hole in the middle is a radial mask, so it is a single element.

View code
<div class="sp3" role="status"><span class="sr">Loading</span></div>
.sp3 { width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(transparent, #a78bfa); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); animation: sp3 .9s linear infinite; }
.sp3 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp3 { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .sp3 { animation-duration: 3s; } }

12. Growing and Shrinking SVG Arc

SpinnerSVG

The arc lengthens and shortens while the whole circle rotates, the material-style spinner. Two animations combine: stroke-dasharray changes the visible arc and a rotate on the svg spins it, at different durations so the pattern never quite repeats.

View code
<svg class="sp4" viewBox="0 0 50 50" role="status" aria-label="Loading"><circle cx="25" cy="25" r="20"/></svg>
.sp4 { width: 52px; height: 52px; animation: sp4r 2s linear infinite; }
.sp4 circle { fill: none; stroke: #2563eb; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 1 150; stroke-dashoffset: 0; animation: sp4d 1.5s ease-in-out infinite; }
@keyframes sp4r { to { transform: rotate(360deg); } }
@keyframes sp4d { 0% { stroke-dasharray: 1 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90 150; stroke-dashoffset: -124; } }
@media (prefers-reduced-motion: reduce) { .sp4 { animation-duration: 6s; } .sp4 circle { animation: none; stroke-dasharray: 60 150; } }

13. Dots Around a Circle

SpinnerDots

Eight dots on a circle grow and fade one after another, giving a rotating feel without anything actually rotating. Each dot is positioned with rotate then translate and scaled by a shared keyframe with a staggered delay.

View code
<div class="sp5" role="status"><span class="sr">Loading</span><i style="--i:0"></i><i style="--i:1"></i><i style="--i:2"></i><i style="--i:3"></i><i style="--i:4"></i><i style="--i:5"></i><i style="--i:6"></i><i style="--i:7"></i></div>
.sp5 { position: relative; width: 56px; height: 56px; }
.sp5 i { position: absolute; left: 24px; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: #34d399; transform: rotate(calc(var(--i) * 45deg)) translateY(-22px) scale(.4); animation: sp5 1s linear infinite; animation-delay: calc(var(--i) * .125s - 1s); }
.sp5 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp5 { 0% { transform: rotate(calc(var(--i) * 45deg)) translateY(-22px) scale(1); } 100% { transform: rotate(calc(var(--i) * 45deg)) translateY(-22px) scale(.4); } }
@media (prefers-reduced-motion: reduce) { .sp5 i { animation-duration: 3s; } }

14. Flipping Square

Spinner3D

A square that flips over its x axis, then its y axis, in a perspective space, an old favourite that still reads clearly as busy. The rotations are four keyframes, each a half turn on alternating axes.

View code
<div class="sp6" role="status"><span class="sr">Loading</span></div>
.sp6 { width: 40px; height: 40px; border-radius: 6px; background: #db2777; animation: sp6 1.4s ease-in-out infinite; }
.sp6 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp6 { 0% { transform: perspective(120px) rotateX(0) rotateY(0); } 50% { transform: perspective(120px) rotateX(-180deg) rotateY(0); } 100% { transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); } }
@media (prefers-reduced-motion: reduce) { .sp6 { animation-duration: 4s; } }

15. Spinner Sizes with currentColor

SpinnerInline

One spinner class in three sizes, inside a button, beside text and on its own, all inheriting their colour from the surrounding text through currentColor. Size comes from the font size in em, so the spinner always matches its context.

View code
<div class="sp7"><button disabled><span class="spin" aria-hidden="true"></span>Saving</button><p><span class="spin" aria-hidden="true"></span>Checking availability…</p><div class="big" role="status"><span class="spin"></span><span class="sr">Loading results</span></div></div>
.sp7 { display: grid; justify-items: center; gap: 14px; font-family: Inter, system-ui, sans-serif; }
.sp7 .spin { display: inline-block; width: 1em; height: 1em; border: .14em solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.15em; animation: sp7 .7s linear infinite; }
.sp7 button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 8px; background: #4f46e5; color: #fff; font: 700 14px Inter, system-ui, sans-serif; }
.sp7 p { margin: 0; display: flex; align-items: center; gap: 8px; color: #fbbf24; font-size: 14px; }
.sp7 .big { color: #38bdf8; font-size: 40px; }
.sp7 .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes sp7 { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp7 .spin { animation-duration: 2.4s; } }

16. Skeleton Card with Shimmer

LoadingShimmer

A placeholder card that shows the shape of the content while it loads: an image block, a title line and two text lines. A light band sweeps across using an animated background gradient, and the card is marked aria-busy with a hidden Loading label.

View code
<div class="skc" aria-busy="true" aria-label="Loading product">
  <div class="sk img"></div>
  <div class="sk t"></div>
  <div class="sk l"></div>
  <div class="sk l s"></div>
</div>
.skc { display: grid; gap: 10px; width: 260px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px -12px rgba(16,24,40,.25); }
.sk { border-radius: 8px; background: linear-gradient(90deg, #eef0f4 25%, #f8f9fb 50%, #eef0f4 75%) 0 0 / 300% 100%; animation: sk-sh 1.4s ease-in-out infinite; }
.sk.img { height: 150px; border-radius: 12px; }
.sk.t { height: 18px; width: 70%; margin-top: 4px; }
.sk.l { height: 12px; }
.sk.s { width: 50%; }
@keyframes sk-sh { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

17. Skeleton List with Avatars

ListLoading

Placeholder rows for a message or contact list, each with a round avatar and two lines of different widths. Varying the widths makes the skeleton look like real text instead of a grid of identical bars, which feels more natural.

View code
<ul class="skl" aria-busy="true" aria-label="Loading messages">
  <li><span class="a"></span><span class="b" style="width:60%"></span><span class="c" style="width:85%"></span></li>
  <li><span class="a"></span><span class="b" style="width:45%"></span><span class="c" style="width:70%"></span></li>
  <li><span class="a"></span><span class="b" style="width:55%"></span><span class="c" style="width:78%"></span></li>
</ul>
.skl { box-sizing: border-box; max-width: 100%; width: min(360px, 90vw); margin: 0; padding: 6px 16px; list-style: none; border-radius: 14px; background: #151a26; }
.skl li { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid #222838; }
.skl li:last-child { border-bottom: 0; }
.skl span { border-radius: 6px; background: #262d3e; animation: skl-p 1.6s ease-in-out infinite; }
.skl .a { grid-row: span 2; width: 42px; height: 42px; border-radius: 50%; }
.skl .b { height: 12px; }
.skl .c { height: 10px; }
@keyframes skl-p { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skl span { animation: none; } }

18. Skeleton Article Page

BlogLoading

A full article placeholder: a wide hero image, a heading in two lines, author details and paragraphs. Using the real page layout for the skeleton means nothing jumps when the content arrives, which keeps the cumulative layout shift score low.

View code
<article class="ska" aria-busy="true" aria-label="Loading article">
  <div class="x hero"></div>
  <div class="x h1"></div><div class="x h1 short"></div>
  <div class="by"><div class="x av"></div><div class="x nm"></div></div>
  <div class="x p"></div><div class="x p"></div><div class="x p short"></div>
</article>
.ska { box-sizing: border-box; max-width: 100%; display: grid; gap: 10px; width: min(460px, 94vw); padding: 18px; border-radius: 16px; background: #fff; }
.x { border-radius: 6px; background: #eceef3; }
.hero { height: 130px; border-radius: 12px; margin-bottom: 6px; }
.h1 { height: 20px; }
.h1.short, .p.short { width: 60%; }
.by { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.av { width: 30px; height: 30px; border-radius: 50%; }
.nm { width: 120px; height: 10px; }
.p { height: 11px; }
.ska .x { position: relative; overflow: hidden; }
.ska .x::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: ska-w 1.5s infinite; }
@keyframes ska-w { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .ska .x::after { animation: none; display: none; } }

19. Skeleton Data Table

TableDashboard

A dashboard table placeholder with a header row and five body rows. Real column headers stay visible while the cells load, so people know what is coming, and the pulse animation is staggered by row with a custom property for a gentle wave.

View code
<table class="skt" aria-busy="true">
  <caption>Recent orders</caption>
  <thead><tr><th scope="col">Order</th><th scope="col">Customer</th><th scope="col">Total</th></tr></thead>
  <tbody>
    <tr style="--r:0"><td><i></i></td><td><i></i></td><td><i></i></td></tr>
    <tr style="--r:1"><td><i></i></td><td><i></i></td><td><i></i></td></tr>
    <tr style="--r:2"><td><i></i></td><td><i></i></td><td><i></i></td></tr>
    <tr style="--r:3"><td><i></i></td><td><i></i></td><td><i></i></td></tr>
  </tbody>
</table>
.skt { width: min(440px, 94vw); border-collapse: collapse; border-radius: 14px; overflow: hidden; background: #151a26; font: 600 13px Inter, system-ui, sans-serif; color: #aab3c7; }
.skt caption { padding: 0 0 10px; color: #fff; font-size: 15px; text-align: left; }
.skt th { padding: 12px 14px; background: #1b2131; text-align: left; }
.skt td { padding: 14px; border-top: 1px solid #222838; }
.skt i { display: block; height: 10px; border-radius: 5px; background: #2a3142; animation: skt-p 1.6s ease-in-out infinite; animation-delay: calc(var(--r) * 120ms); }
.skt td:nth-child(2) i { width: 80%; }
.skt td:nth-child(3) i { width: 50%; }
@keyframes skt-p { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .skt i { animation: none; } }

20. Skeleton Profile Header

ProfileLoading

A profile page placeholder with a cover banner, an overlapping round avatar, a name line and three stat blocks. The avatar overlap is done with a negative margin, matching the loaded design exactly so the swap from skeleton to content is seamless.

View code
<section class="skp" aria-busy="true" aria-label="Loading profile">
  <div class="cv"></div>
  <div class="av"></div>
  <div class="nm"></div>
  <div class="stats"><div></div><div></div><div></div></div>
</section>
.skp { width: min(380px, 90vw); overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px -12px rgba(16,24,40,.25); text-align: center; }
.skp div { background: #eceef3; }
.cv { height: 90px; background: linear-gradient(90deg, #e5e8ee, #f1f3f6) !important; }
.skp .av { width: 76px; height: 76px; margin: -38px auto 10px; border: 4px solid #fff; border-radius: 50%; }
.nm { width: 140px; height: 14px; margin: 0 auto 18px; border-radius: 7px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 18px 18px; background: none !important; }
.stats div { height: 40px; border-radius: 10px; }
.skp div { animation: skp-p 1.6s ease-in-out infinite; }
@keyframes skp-p { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skp div { animation: none; } }

21. Skeleton Product Grid

E-commerceGrid

Four product placeholders in a responsive grid, the same columns as the real catalogue. Each tile has an image block, a name and a price bar; the shimmer is one gradient fixed to the viewport with background-attachment, so all tiles shimmer in sync.

View code
<div class="skg" aria-busy="true" aria-label="Loading products">
  <div class="tile"><div class="im"></div><div class="n"></div><div class="pr"></div></div>
  <div class="tile"><div class="im"></div><div class="n"></div><div class="pr"></div></div>
  <div class="tile"><div class="im"></div><div class="n"></div><div class="pr"></div></div>
  <div class="tile"><div class="im"></div><div class="n"></div><div class="pr"></div></div>
</div>
.skg { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; width: min(560px, 94vw); }
.tile { display: grid; gap: 8px; }
.skg .tile div { border-radius: 8px; background: linear-gradient(100deg, #1e2433 40%, #2c3448 50%, #1e2433 60%) fixed; background-size: 200% 100%; animation: skg-s 1.5s linear infinite; }
.im { aspect-ratio: 1; border-radius: 12px !important; }
.n { height: 12px; width: 80%; }
.pr { height: 12px; width: 40%; }
@keyframes skg-s { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skg .tile div { animation: none; } }

22. Skeleton to Content Swap

JavaScriptState

A card that shows its skeleton for a moment and then swaps in the real content, the full pattern rather than just the placeholder. aria-busy flips from true to false when the content arrives, and a Reload button lets you replay the transition.

View code
<div class="swap">
  <div class="card" id="sc" aria-busy="true" aria-live="polite">
    <div class="ph"><span></span><span></span><span class="s"></span></div>
    <div class="real" hidden><h3>Linen tote bag</h3><p>Natural fibre, 40 x 38 cm, inside pocket.</p><b>$32.00</b></div>
  </div>
  <button id="rl">Reload</button>
</div>
.swap { display: grid; gap: 12px; justify-items: start; font-family: Inter, system-ui, sans-serif; }
.card { width: 280px; min-height: 120px; padding: 18px; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px -12px rgba(16,24,40,.25); }
.ph { display: grid; gap: 10px; }
.ph span { height: 14px; border-radius: 7px; background: #eceef3; animation: sw-p 1.4s ease-in-out infinite; }
.ph .s { width: 40%; }
.real h3 { margin: 0 0 6px; color: #101828; font-size: 17px; }
.real p { margin: 0 0 10px; color: #475467; font-size: 14px; }
.real b { color: #101828; }
.swap button { padding: 8px 14px; border: 1.5px solid #d0d5dd; border-radius: 10px; background: #fff; font: 700 13px Inter, sans-serif; cursor: pointer; }
@keyframes sw-p { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ph span { animation: none; } }
const sc = document.getElementById('sc');
function load() {
  sc.setAttribute('aria-busy', 'true'); sc.querySelector('.ph').hidden = false; sc.querySelector('.real').hidden = true;
  setTimeout(() => { sc.querySelector('.ph').hidden = true; sc.querySelector('.real').hidden = false; sc.setAttribute('aria-busy', 'false'); }, 1600);
}
document.getElementById('rl').addEventListener('click', load);
load();

23. Skeleton Chat Thread

ChatLoading

Placeholder chat bubbles that alternate left and right, with different widths, to suggest a conversation loading. The bubble shapes match real messages, including the flattened corner on the speaker's side, so the loaded thread lines up exactly.

View code
<div class="skch" aria-busy="true" aria-label="Loading conversation">
  <span class="in" style="width:62%"></span>
  <span class="in" style="width:40%"></span>
  <span class="out" style="width:55%"></span>
  <span class="in" style="width:70%"></span>
  <span class="out" style="width:35%"></span>
</div>
.skch { box-sizing: border-box; max-width: 100%; display: flex; flex-direction: column; gap: 10px; width: min(340px, 90vw); padding: 16px; border-radius: 16px; background: #12161f; }
.skch span { height: 34px; border-radius: 16px; background: #262d3e; animation: skc-p 1.6s ease-in-out infinite; }
.skch .in { align-self: flex-start; border-bottom-left-radius: 4px; }
.skch .out { align-self: flex-end; border-bottom-right-radius: 4px; background: #2b3a6b; }
@keyframes skc-p { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skch span { animation: none; } }

About these CSS Loaders

Which loader to use when

Under about a second, show nothing; a flash of spinner feels slower than no feedback. For one to three seconds, a small spinner or dots is enough. For content that is loading, such as a feed or a product grid, use a skeleton in the shape of that content. When you know how far along a task is, show real progress with a bar or ring.

Making loaders accessible

A spinning circle means nothing to a screen reader unless you say what it is. Give the loader role="status" and a label such as "Loading", or use a native <progress> element. For known progress, role="progressbar" with aria-valuenow lets assistive technology read the number.

Keeping animations smooth

Every loader here animates only transform and opacity, which the browser can run on the GPU without recalculating the page layout. That keeps them smooth even while the main thread is busy loading the thing you are waiting for. Each one also has a prefers-reduced-motion rule that slows or removes the motion.

How to use these demos

Each loader is scoped with a .ttl- class prefix. Show it while your request is pending and remove it, or swap it for the content, when the request finishes. Open any loader in the editor to change its size and colours with a live preview.

Frequently asked questions

Are pure CSS loaders better than GIFs?

Usually, yes. They are a few hundred bytes instead of kilobytes, stay sharp at any size and screen density, and you can recolour them with one line of CSS.

Do these loaders affect page speed?

Barely. They are tiny and animate only transform and opacity, so they do not cause layout work. A skeleton that matches the final content size also prevents layout shift when the content arrives.

Can I change the colours?

Yes. Each loader uses two or three hex colours. Replace them with your brand colours, or open the loader in the editor and change them with a live preview.