# Infinity Loader

> A glowing segment that races endlessly around a figure-eight SVG path.

- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: figure eight, svg, path, stroke-dashoffset, snake
- Live preview: https://copy-css.com/snippets/infinity-loader
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<svg class="loader-infinity" viewBox="0 0 48 24" role="status" aria-label="Loading">
  <path class="loader-infinity-track" d="M24 12C20 4 6 4 6 12s14 8 18 0 18-8 18 0-14 8-18 0"/>
  <path class="loader-infinity-snake" pathLength="100" d="M24 12C20 4 6 4 6 12s14 8 18 0 18-8 18 0-14 8-18 0"/>
</svg>
```

## CSS

```css
.loader-infinity {
  width: 120px;
  height: 60px;
  overflow: visible;
}

.loader-infinity path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.loader-infinity-track {
  stroke: #1e293b;
}

.loader-infinity-snake {
  stroke: #22d3ee;
  stroke-dasharray: 22 78;
  filter: drop-shadow(0 0 3px #22d3ee);
  animation: loader-infinity-run 1.6s linear infinite;
}

@keyframes loader-infinity-run {
  to { stroke-dashoffset: -100; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-infinity-snake { animation-duration: 4s; }
}
```

## Notes

- This CSS Infinity Loader is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, filters and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
