CSS LED Scanner Loader

A row of LED segments with a red light sweeping back and forth, in the style of an 80s car scanner.

  • scanning
  • sweep
  • segments
  • retro
  • red light
  • mask
HTML
<div class="loader-scanner" role="status" aria-label="Loading"></div>
CSS
.loader-scanner {
  width: 136px;
  height: 10px;
  background:
    linear-gradient(90deg, #0000, #ef4444, #fca5a5, #ef4444, #0000) 0 0 / 40% 100% no-repeat,
    #3b0a0a;
  /* Cut the bar into 7 segments */
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 16px, #0000 16px 20px);
  mask: repeating-linear-gradient(90deg, #000 0 16px, #0000 16px 20px);
  animation: loader-scanner-sweep 1.2s ease-in-out infinite alternate;
}

@keyframes loader-scanner-sweep {
  to { background-position: 100% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-scanner { animation-duration: 3s; }
}

About this CSS LED Scanner Loader

This CSS LED Scanner Loader is 19 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, masks and reduced-motion support. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #0000
  • #ef4444
  • #fca5a5
  • #3b0a0a
  • #000

How to use this led scanner loader

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .loader-scanner class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback