Skip to content

Stepped Slider

A copy-paste sliders & ranges component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Sliders & RangesHTMLCSSany framework
SMLXLXXL

Copy into your project

HTML
<div class="nuda-stepslider">
  <div class="nuda-stepslider__track">
    <div class="nuda-stepslider__fill" style="width:50%"></div>
    <span class="nuda-stepslider__tick is-on" style="left:0%"></span>
    <span class="nuda-stepslider__tick is-on" style="left:25%"></span>
    <span class="nuda-stepslider__tick is-on" style="left:50%"></span>
    <span class="nuda-stepslider__tick" style="left:75%"></span>
    <span class="nuda-stepslider__tick" style="left:100%"></span>
    <div class="nuda-stepslider__thumb" style="left:50%"></div>
  </div>
  <div class="nuda-stepslider__labels">
    <span>S</span><span>M</span><span>L</span><span>XL</span><span>XXL</span>
  </div>
</div>
CSS
.nuda-stepslider {
  width: 100%;
  max-width: 240px;
  padding: 10px 12px;
}

.nuda-stepslider__track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 99px;
  margin-bottom: 8px;
}

.nuda-stepslider__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #e4ff54;
  border-radius: 99px;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}

.nuda-stepslider__tick {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0c0c10;
  border: 1px solid rgba(255,255,255,.16);
  transform: translate(-50%,-50%);
  transition: background .3s,border-color .3s,transform .3s;
}

.nuda-stepslider__tick.is-on {
  background: #e4ff54;
  border-color: #e4ff54;
  transform: translate(-50%,-50%) scale(1.1);
}

.nuda-stepslider__thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid #e4ff54;
  transform: translate(-50%,-50%);
  cursor: grab;
  z-index: 1;
}

.nuda-stepslider__labels {
  display: flex;
  justify-content: space-between;
  color: #63636e;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
}

How to use Stepped Slider

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 sliders & ranges components

← Browse all NudaUI components