Skip to content

Styled Select

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

Dropdowns & MenusHTMLCSSany framework
Medium
  • Small
  • Medium
  • Large

Copy into your project

HTML
<div class="nuda-sel">
  <div class="nuda-sel__field">Medium <span class="nuda-sel__caret">▾</span></div>
  <ul class="nuda-sel__menu">
    <li class="nuda-sel__item">Small</li>
    <li class="nuda-sel__item nuda-sel__item--sel">Medium</li>
    <li class="nuda-sel__item">Large</li>
  </ul>
</div>
CSS
.nuda-sel {
  position: relative;
  display: inline-block;
  min-width: 140px;
}

.nuda-sel__field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: .5rem .7rem;
  font-size: .8rem;
  color: #fafafa;
  cursor: pointer;
}

.nuda-sel__caret {
  color: #777;
  font-size: .7rem;
}

.nuda-sel__menu {
  list-style: none;
  margin: .4rem 0 0;
  padding: .3rem;
  background: #141414;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  animation: _selIn .18s ease-out;
}

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

.nuda-sel__item:hover {
  background: rgba(255,255,255,.05);
}

.nuda-sel__item--sel {
  color: #e4ff54;
}

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

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

How to use Styled Select

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