18 CSS Play / Pause Button Designs

Neon Arcade

Stacked neon-cyan glow with monospace label. The play / pause icon sits inside a glowing ring that pulses while playing — synthwave 80s arcade vibes for gaming, retro media, and dev tools.

Light JS MIT licensed

Neon Arcade the 8th of 18 designs in the 18 CSS Play / Pause Button Designs collection. The design pairs CSS styling with a small amount of JavaScript for interactivity. Copy the HTML, CSS and JavaScript panels below into your project — the JS is self-contained, has zero dependencies, and is safe to drop into any framework (React, Vue, Svelte, plain HTML). The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<button class="pp-neon" type="button" aria-pressed="false" aria-label="Play" data-pp>
  <span class="pp-neon-ring" aria-hidden="true">
    <svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true">
      <path class="pp-neon-icon" d="M8 5 L8 19 L19 12 Z" fill="currentColor" />
    </svg>
  </span>
  <span class="pp-neon-label" aria-hidden="true">
    <span class="pp-neon-text pp-neon-text-play">PLAY</span>
    <span class="pp-neon-text pp-neon-text-pause">PAUSE</span>
  </span>
</button>
.pp-neon {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 22px 10px 16px;
  background: #0a0014;
  border: 1px solid rgba(108, 255, 255, 0.4);
  border-radius: 8px;
  color: #6cffff;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  text-shadow: 0 0 8px rgba(108, 255, 255, 0.6);
  box-shadow:
    inset 0 0 12px rgba(108, 255, 255, 0.1),
    0 0 14px rgba(108, 255, 255, 0.25);
  transition:
    box-shadow 0.25s,
    border-color 0.2s,
    transform 0.15s;
}
.pp-neon:hover {
  border-color: #6cffff;
  box-shadow:
    inset 0 0 18px rgba(108, 255, 255, 0.2),
    0 0 22px rgba(108, 255, 255, 0.5);
  transform: translateY(-1px);
}
.pp-neon:focus-visible {
  outline: 3px solid rgba(108, 255, 255, 0.5);
  outline-offset: 3px;
}
.pp-neon-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid #6cffff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(108, 255, 255, 0.4);
}
.pp-neon[aria-pressed="true"] .pp-neon-ring {
  animation: ppNeonPulse 1.4s ease-in-out infinite;
}
@keyframes ppNeonPulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(108, 255, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(108, 255, 255, 0.85);
  }
}
.pp-neon-ring svg {
  display: block;
}
.pp-neon-label {
  position: relative;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  /* Reserve width of the longer label (PAUSE) so the button
     doesn't reflow when the state flips. */
  min-width: 4ch;
  text-align: left;
}
.pp-neon-text {
  display: none;
}
.pp-neon[aria-pressed="false"] .pp-neon-text-play {
  display: inline;
}
.pp-neon[aria-pressed="true"] .pp-neon-text-pause {
  display: inline;
}
.pp-neon-icon {
  transition: d 0.3s cubic-bezier(0.5, 0, 0.3, 1.2);
}
.pp-neon[aria-pressed="true"] .pp-neon-icon {
  d: path("M7 5 H10 V19 H7 Z M14 5 H17 V19 H14 Z");
}

@media (prefers-reduced-motion: reduce) {
  .pp-neon,
  .pp-neon * {
    animation: none !important;
  }
}
// ── Drop this on every page where you render a play/pause button ──
// Toggles aria-pressed + aria-label on click. The CSS handles all visuals.
document.querySelectorAll('[data-pp]').forEach(function (btn) {
  btn.addEventListener('click', function () {
    var playing = btn.getAttribute('aria-pressed') === 'true';
    btn.setAttribute('aria-pressed', String(!playing));
    btn.setAttribute('aria-label', !playing ? 'Pause' : 'Play');
  });
});

Search CodeFronts

Loading…