Skip to content

Sound Preferences

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

Settings & PreferencesHTMLCSSany framework
Sound effects62%

Copy into your project

HTML
<div class="nuda-sound">
  <div class="nuda-sound__head">
    <span class="nuda-sound__title">Sound effects</span>
    <span class="nuda-sound__val">62%</span>
  </div>
  <div class="nuda-sound__controls">
    <button type="button" class="nuda-sound__play" aria-label="Play sample">
      <svg viewBox="0 0 12 12" aria-hidden="true">
        <path d="M3.5 2.5v7l6-3.5z" fill="currentColor" />
      </svg>
    </button>
    <div class="nuda-sound__track">
      <input class="nuda-sound__slider" type="range" min="0" max="100"
             value="62" aria-label="Volume" />
    </div>
    <div class="nuda-sound__bars" aria-hidden="true">
      <span></span><span></span><span></span><span></span><span></span>
    </div>
  </div>
</div>
CSS
/* Sound Preferences
   Volume slider with a sample player button and animated bars.
   Customize: --accent, --card-bg */

.nuda-sound {
  --accent: #e4ff54;
  --card-bg: #0c0c10;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
}

.nuda-sound__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nuda-sound__title {
  color: #fafafa;
  font-size: 0.875rem;
  font-weight: 500;
}

.nuda-sound__val {
  color: var(--accent);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.nuda-sound__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nuda-sound__play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #09090b;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nuda-sound__play svg {
  width: 12px;
  height: 12px;
  margin-left: 1px;
}

.nuda-sound__play:hover {
  background: #d4ef44;
  transform: scale(1.05);
}

.nuda-sound__play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nuda-sound__track {
  flex: 1;
}

.nuda-sound__slider {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0 62%,
    rgba(255, 255, 255, 0.1) 62% 100%
  );
  cursor: pointer;
  outline: 0;
}

.nuda-sound__slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.nuda-sound__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.nuda-sound__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  flex-shrink: 0;
}

.nuda-sound__bars span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: nuda-sound-bar 1.1s ease-in-out infinite;
}

.nuda-sound__bars span:nth-child(1) { height: 40%;  animation-delay: 0s;   }
.nuda-sound__bars span:nth-child(2) { height: 75%;  animation-delay: 0.1s; }
.nuda-sound__bars span:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.nuda-sound__bars span:nth-child(4) { height: 60%;  animation-delay: 0.3s; }
.nuda-sound__bars span:nth-child(5) { height: 35%;  animation-delay: 0.4s; }

@keyframes nuda-sound-bar {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1);   }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-sound__play {
    transition: none;
  }
  .nuda-sound__bars span {
    animation: none;
    transform: scaleY(0.7);
  }
}

How to use Sound Preferences

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 settings & preferences components

← Browse all NudaUI components