Skip to content

Slide Dropdown

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

Dropdowns & MenusHTMLCSSany framework
  • Newest
  • Oldest
  • Popular

Copy into your project

HTML
<div class="nuda-ddsl">
  <button class="nuda-ddsl__trigger">Filter ▾</button>
  <ul class="nuda-ddsl__menu">
    <li class="nuda-ddsl__item">Newest</li>
    <li class="nuda-ddsl__item">Oldest</li>
    <li class="nuda-ddsl__item">Popular</li>
  </ul>
</div>
CSS
.nuda-ddsl {
  position: relative;
  display: inline-block;
  overflow: visible;
}

.nuda-ddsl__trigger {
  background: #1a1a1a;
  color: #fafafa;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .5rem .9rem;
  font-size: .8rem;
  cursor: pointer;
}

.nuda-ddsl__menu {
  list-style: none;
  margin: .4rem 0 0;
  padding: .35rem;
  min-width: 150px;
  background: #141414;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  animation: _ddslIn .25s cubic-bezier(.16,1,.3,1);
}

.nuda-ddsl__item {
  padding: .5rem .6rem;
  border-radius: 6px;
  font-size: .8rem;
  color: #cfcfcf;
  cursor: pointer;
}

.nuda-ddsl__item:hover {
  background: rgba(228,255,84,.1);
  color: #fafafa;
}

@keyframes _ddslIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ddsl__menu {
    animation: none;
  }
}

How to use Slide Dropdown

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 dropdowns & menus components

← Browse all NudaUI components