Destructive Action Menu
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-dm2-destructive">
<button class="nuda-dm2-destructive__trigger" type="button" aria-haspopup="menu" aria-expanded="true">Options ▾</button>
<div class="nuda-dm2-destructive__menu" role="menu" aria-label="Options">
<button class="nuda-dm2-destructive__item" type="button" role="menuitem">Rename</button>
<button class="nuda-dm2-destructive__item" type="button" role="menuitem">Duplicate</button>
<div class="nuda-dm2-destructive__sep" role="separator"></div>
<button class="nuda-dm2-destructive__item nuda-dm2-destructive__item--danger" type="button" role="menuitem">
<svg class="nuda-dm2-destructive__ic" aria-hidden="true" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"></path>
</svg>
Delete conversation
</button>
</div>
</div>CSS
.nuda-dm2-destructive {
position: relative;
display: inline-block;
font-family: inherit;
transform-origin: top left;
}
.nuda-dm2-destructive__trigger {
background: #1a1a1a;
color: #fafafa;
border: 1px solid rgba(255,255,255,.12);
border-radius: 8px;
padding: .55rem .9rem;
font-size: .8rem;
cursor: pointer;
min-height: 44px;
}
.nuda-dm2-destructive__trigger:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: 2px;
}
.nuda-dm2-destructive__menu {
margin: .4rem 0 0;
padding: .35rem;
width: 220px;
background: #141414;
border: 1px solid rgba(255,255,255,.1);
border-radius: 10px;
transform-origin: top left;
animation: _nuda-dm2destructiveIn .2s ease-out;
}
.nuda-dm2-destructive__item {
display: flex;
align-items: center;
gap: .55rem;
width: 100%;
box-sizing: border-box;
min-height: 44px;
padding: .5rem .65rem;
border: 0;
background: transparent;
border-radius: 6px;
font-size: .8rem;
color: #cfcfcf;
text-align: left;
cursor: pointer;
transition: background .15s ease,color .15s ease;
}
.nuda-dm2-destructive__item:hover,.nuda-dm2-destructive__item:focus-visible {
background: rgba(255,255,255,.06);
color: #fafafa;
}
.nuda-dm2-destructive__item:focus-visible {
outline: 2px solid #e4ff54;
outline-offset: -2px;
}
.nuda-dm2-destructive__sep {
height: 1px;
margin: .3rem .2rem;
background: rgba(255,255,255,.1);
}
.nuda-dm2-destructive__item--danger {
color: #ff6b6b;
}
.nuda-dm2-destructive__item--danger:hover,.nuda-dm2-destructive__item--danger:focus-visible {
background: rgba(255,90,90,.12);
color: #ff8080;
}
.nuda-dm2-destructive__ic {
flex: 0 0 auto;
}
@keyframes _nuda-dm2destructiveIn {
from {
opacity: 0;
transform: translateY(-6px) scale(.98);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-dm2-destructive__menu {
animation: none !important;
}
}
How to use Destructive Action Menu
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.