Split Button
A copy-paste dropdowns & menus component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Dropdowns & MenusHTMLCSSany framework
Copy into your project
HTML
<div class="nuda-split">
<button class="nuda-split__main">Save</button>
<button class="nuda-split__toggle">▾</button>
<ul class="nuda-split__menu">
<li class="nuda-split__item">Save as draft</li>
<li class="nuda-split__item">Save & publish</li>
</ul>
</div>CSS
.nuda-split {
position: relative;
display: inline-flex;
}
.nuda-split__main {
background: #e4ff54;
color: #0a0a0a;
border: none;
border-radius: 8px 0 0 8px;
padding: .5rem .9rem;
font-size: .8rem;
font-weight: 600;
cursor: pointer;
}
.nuda-split__toggle {
background: #c8e23c;
color: #0a0a0a;
border: none;
border-left: 1px solid rgba(0,0,0,.15);
border-radius: 0 8px 8px 0;
padding: .5rem .6rem;
font-size: .7rem;
cursor: pointer;
}
.nuda-split__menu {
position: absolute;
top: 100%;
right: 0;
margin-top: .4rem;
list-style: none;
padding: .35rem;
min-width: 160px;
background: #141414;
border: 1px solid rgba(255,255,255,.1);
border-radius: 10px;
animation: _splitIn .2s ease-out;
}
.nuda-split__item {
padding: .5rem .6rem;
border-radius: 6px;
font-size: .8rem;
color: #cfcfcf;
cursor: pointer;
white-space: nowrap;
}
.nuda-split__item:hover {
background: rgba(228,255,84,.1);
color: #fafafa;
}
@keyframes _splitIn {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-split__menu {
animation: none;
}
}
How to use Split Button
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.