Floating Action Dock
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
<div class="nuda-fab is-open">
<button class="nuda-fab__main" aria-label="Open actions">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round">
<path d="M12 5v14M5 12h14" />
</svg>
</button>
<div class="nuda-fab__items">
<button class="nuda-fab__item" style="--d: 0ms">📄</button>
<button class="nuda-fab__item" style="--d: 60ms">🖼️</button>
<button class="nuda-fab__item" style="--d: 120ms">🎵</button>
<button class="nuda-fab__item" style="--d: 180ms">💻</button>
</div>
</div>JavaScript
const fab = document.querySelector('.nuda-fab');
fab.querySelector('.nuda-fab__main').addEventListener('click', () => {
fab.classList.toggle('is-open');
});CSS
.nuda-fab {
position: relative;
width: 46px;
height: 46px;
}
.nuda-fab__main {
position: relative;
width: 46px;
height: 46px;
border-radius: 50%;
border: 0;
background: #e4ff54;
color: #09090b;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8px 22px -8px rgba(228,255,84,.6);
transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.nuda-fab__main svg {
width: 18px;
height: 18px;
transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.nuda-fab.is-open .nuda-fab__main {
transform: rotate(45deg);
}
.nuda-fab__items {
position: absolute;
bottom: calc(100% + 8px);
left: 50%;
transform: translateX(-50%);
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
}
.nuda-fab__item {
width: 38px;
height: 38px;
border-radius: 50%;
border: 1px solid rgba(255,255,255,.08);
background: #111114;
color: #fafafa;
font-size: 14px;
cursor: pointer;
opacity: 0;
transform: scale(.4) translateY(8px);
transition: opacity .35s,transform .45s cubic-bezier(.34,1.56,.64,1);
transition-delay: var(--d, 0ms);
box-shadow: 0 4px 12px -4px rgba(0,0,0,.6);
}
.nuda-fab.is-open .nuda-fab__item {
opacity: 1;
transform: scale(1) translateY(0);
}
.nuda-fab__item:hover {
transform: scale(1.1);
}
How to use Floating Action Dock
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.