Skip to content

Chapter Scrub Bar

A copy-paste video player ui component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Video Player UIHTMLCSSany framework
Chapter 2 · The Reveal

Copy into your project

HTML
<!-- Chapter Scrub Bar — ticks mark chapter boundaries; label reflects current chapter -->
<div class="nuda-vp2-chapter-scrub">
  <div class="nuda-vp2-chapter-scrub__track-wrap">
    <div class="nuda-vp2-chapter-scrub__ticks" aria-hidden="true">
      <span class="nuda-vp2-chapter-scrub__tick" style="left: 22%"></span>
      <span class="nuda-vp2-chapter-scrub__tick" style="left: 55%"></span>
      <span class="nuda-vp2-chapter-scrub__tick" style="left: 81%"></span>
    </div>
    <input
      class="nuda-vp2-chapter-scrub__range"
      type="range" min="0" max="100" value="42"
      aria-label="Seek"
      aria-valuetext="1:04 of 3:00 — Chapter 2: The Reveal"
    />
  </div>
  <div class="nuda-vp2-chapter-scrub__label">Chapter 2 · The Reveal</div>
</div>
CSS
.nuda-vp2-chapter-scrub {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
}

.nuda-vp2-chapter-scrub__track-wrap {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

.nuda-vp2-chapter-scrub__ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.nuda-vp2-chapter-scrub__tick {
  position: absolute;
  top: 0;
  width: 2px;
  height: 10px;
  background: #09090b;
  border-radius: 1px;
}

.nuda-vp2-chapter-scrub__range {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg,#e4ff54 0 42%,rgba(255,255,255,.14) 42% 100%);
  cursor: pointer;
  outline: 0;
  margin: 0;
}

.nuda-vp2-chapter-scrub__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid #e4ff54;
  cursor: pointer;
  transition: transform .2s ease,box-shadow .2s ease;
}

.nuda-vp2-chapter-scrub__range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid #e4ff54;
  cursor: pointer;
  transition: transform .2s ease,box-shadow .2s ease;
}

.nuda-vp2-chapter-scrub__range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(228,255,84,.25);
}

.nuda-vp2-chapter-scrub__range:focus-visible::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(228,255,84,.25);
}

.nuda-vp2-chapter-scrub__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 10px ui-sans-serif,system-ui,sans-serif;
  color: #cfcfcf;
}

.nuda-vp2-chapter-scrub__label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e4ff54;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(228,255,84,.6);
}

@media (prefers-reduced-motion:reduce) {
  .nuda-vp2-chapter-scrub__range::-webkit-slider-thumb {
    transition: none;
  }
  .nuda-vp2-chapter-scrub__range::-moz-range-thumb {
    transition: none;
  }
  .nuda-vp2-chapter-scrub__range:focus-visible::-webkit-slider-thumb {
    transform: none;
  }
  .nuda-vp2-chapter-scrub__range:focus-visible::-moz-range-thumb {
    transform: none;
  }
}

How to use Chapter Scrub Bar

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More video player ui components

← Browse all NudaUI components