Active Indicator Glide
A copy-paste sidebars & docks component in pure HTML, CSS & vanilla JS. Zero dependencies, framework-agnostic, MIT-licensed.
Sidebars & DocksHTMLJavaScriptCSSany framework
Copy into your project
HTML
<nav aria-label="Main" class="nuda-sb2-active-glide" style="--active: 1">
<span class="nuda-sb2-active-glide__indicator" aria-hidden="true"></span>
<ul class="nuda-sb2-active-glide__list">
<li>
<button type="button" class="nuda-sb2-active-glide__btn" aria-label="Home" data-index="0">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 11l9-8 9 8v10a2 2 0 01-2 2h-4v-7H9v7H5a2 2 0 01-2-2V11z" />
</svg>
</button>
</li>
<!-- More items with data-index="1", "2" … -->
</ul>
</nav>JavaScript
const rail = document.querySelector('.nuda-sb2-active-glide');
rail.querySelectorAll('.nuda-sb2-active-glide__btn').forEach((btn) => {
btn.addEventListener('click', () => {
rail.style.setProperty('--active', btn.dataset.index);
rail.querySelectorAll('.nuda-sb2-active-glide__btn').forEach((b) => {
b.removeAttribute('aria-current');
});
btn.setAttribute('aria-current', 'page');
});
});CSS
.nuda-sb2-active-glide {
position: relative;
width: 56px;
padding: 8px;
background: rgba(255,255,255,.02);
border: 1px solid rgba(255,255,255,.08);
border-radius: 16px;
}
.nuda-sb2-active-glide__list {
position: relative;
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 4px;
z-index: 1;
}
.nuda-sb2-active-glide__btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: 0;
border-radius: 10px;
color: #a0a0a8;
cursor: pointer;
transition: color .25s;
}
.nuda-sb2-active-glide__btn svg {
width: 18px;
height: 18px;
}
.nuda-sb2-active-glide__btn:hover {
color: #fafafa;
}
.nuda-sb2-active-glide__btn[aria-current="page"] {
color: #0a0a0a;
}
.nuda-sb2-active-glide__btn:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-sb2-active-glide__indicator {
position: absolute;
left: 8px;
top: 8px;
width: 40px;
height: 40px;
border-radius: 10px;
background: #e4ff54;
transform: translateY(calc(var(--active, 0) * 44px));
transition: transform .45s cubic-bezier(.34,1.56,.64,1);
box-shadow: 0 6px 16px -6px rgba(228,255,84,.5);
}
@media (prefers-reduced-motion:reduce) {
.nuda-sb2-active-glide__indicator {
transition: none;
}
}
How to use Active Indicator Glide
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.