Back to the library

Starburst loader, hairline

Variant: Hairline

The same clockwise starburst sweep with 1.5px rays, smaller tip dots, a lower peak opacity and only a 1.5-unit outward push. Use it inline in dense views like table headers, sidebars and settings panes, where a loader should be noticeable without taking over. The cycle and the linear timing match the standard version. Only the weight changes, so the hairline and standard versions keep the same rhythm when used on the same screen.

loaderspinnerstarburstminimalsvg

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Starburst loader — Hairline</title>
<style>
:root {
  /* Neutrals — fixed, never remixed. */
  --ivory: #faf9f5;
  --paper: #ffffff;
  --oat: #e3dacc;
  --slate: #141413;

  /* Knobs — the remix API. A knob exists iff declared here and used below. */
  --hue: 38.8;
  --lift: 0;
  --chroma: 1;
  --round: 1; /* include ONLY if at least one border-radius is wrapped below */
  --speed: 1;

  /* Accents — derived from the knobs with the family's offsets baked in,
     so one hue roll moves them together. Defaults reproduce the original hex
     (#d97757 / #b85c3e / #788c5d / #b04a3f). */
  --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
  --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
  --olive: oklch(calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3));
  --rust: oklch(calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3));

  /* Clock — every duration in the document runs off --t. */
  --cycle: 1.6s; /* the authored master loop */
  --t: calc(var(--cycle) / var(--speed));

  --_mustard: oklch(calc(0.78 + var(--lift)) calc(0.135 * var(--chroma)) calc(var(--hue) + 45));
  --_walnut: oklch(calc(0.42 + var(--lift)) calc(0.06 * var(--chroma)) calc(var(--hue) + 12));
  --_stroke: 1.5px;
  --_reach: 1.5;
  --_rest: 0.18;
  --_peak: 0.75;
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ivory);
  color: var(--slate);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

.card {
  display: grid;
  justify-items: center;
  gap: clamp(10px, 3vw, 16px);
  padding: clamp(18px, 5vw, 28px) clamp(22px, 7vw, 40px);
  background: var(--paper);
  border: 1px solid var(--oat);
  border-radius: calc(20px * var(--round));
  text-align: center;
  max-width: 92vw;
}

.burst {
  display: block;
  width: min(120px, 28vw, 34vh);
  aspect-ratio: 1;
  height: auto;
}

.ray line {
  stroke: currentColor;
  stroke-width: var(--_stroke);
  stroke-linecap: round;
}
.ray circle { fill: currentColor; }

/* Negative delays place each ray at its own phase; i/12 of the cycle apart puts the head moving clockwise. */
.ray {
  opacity: var(--_rest);
  animation: sweep var(--t) linear infinite;
  animation-delay: calc(var(--t) * (var(--_i) / 12 - 1));
}

.spoke:nth-child(3n+1) { color: var(--clay); }
.spoke:nth-child(3n+2) { color: var(--olive); }
.spoke:nth-child(3n+3) { color: var(--_mustard); }

.spoke:nth-child(1) { --_i: 0; }
.spoke:nth-child(2) { --_i: 1; }
.spoke:nth-child(3) { --_i: 2; }
.spoke:nth-child(4) { --_i: 3; }
.spoke:nth-child(5) { --_i: 4; }
.spoke:nth-child(6) { --_i: 5; }
.spoke:nth-child(7) { --_i: 6; }
.spoke:nth-child(8) { --_i: 7; }
.spoke:nth-child(9) { --_i: 8; }
.spoke:nth-child(10) { --_i: 9; }
.spoke:nth-child(11) { --_i: 10; }
.spoke:nth-child(12) { --_i: 11; }

.hub { fill: var(--_walnut); }

.title {
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.sub {
  margin-top: 2px;
  font-size: clamp(12px, 3.2vw, 13px);
  opacity: 0.62;
}

/* A short rise (8%) instead of a hard switch-on keeps the outward push from flickering at the head. */
@keyframes sweep {
  0% { opacity: var(--_rest); transform: translateY(0); }
  8% { opacity: var(--_peak); transform: translateY(calc(var(--_reach) * -1px)); }
  60% { opacity: var(--_rest); transform: translateY(0); }
  100% { opacity: var(--_rest); transform: translateY(0); }
}

@keyframes sweep-calm {
  0% { opacity: calc(var(--_rest) + 0.15); }
  8% { opacity: var(--_peak); }
  60% { opacity: calc(var(--_rest) + 0.15); }
  100% { opacity: calc(var(--_rest) + 0.15); }
}

@media (max-width: 380px) {
  .card { padding: 16px 20px; gap: 10px; border-radius: calc(16px * var(--round)); }
}

@media (prefers-reduced-motion: reduce) {
  .ray {
    animation-name: sweep-calm;
    animation-duration: calc(var(--t) * 2);
    animation-delay: calc(var(--t) * 2 * (var(--_i) / 12 - 1));
  }
}
</style>
</head>
<body>
  <div class="card" role="status" aria-live="polite">
    <svg class="burst" viewBox="-56 -56 112 112" aria-hidden="true">
      <g class="spokes">
        <g class="spoke" transform="rotate(0)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(30)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
        <g class="spoke" transform="rotate(60)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(90)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
        <g class="spoke" transform="rotate(120)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(150)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
        <g class="spoke" transform="rotate(180)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(210)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
        <g class="spoke" transform="rotate(240)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(270)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
        <g class="spoke" transform="rotate(300)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-33" /><circle cx="0" cy="-43" r="2.4" /></g></g>
        <g class="spoke" transform="rotate(330)"><g class="ray"><line x1="0" y1="-15" x2="0" y2="-27" /></g></g>
      </g>
      <circle class="hub" cx="0" cy="0" r="4" />
    </svg>
    <div>
      <p class="title">Loading your collection</p>
      <p class="sub">Fetching the latest pieces</p>
    </div>
  </div>
</body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.