Skip to content

Accessibility Section

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

Settings & PreferencesHTMLCSSany framework

Accessibility

Font size16px
Reduce motionMinimize animations across the app.

Copy into your project

HTML
<section class="nuda-a11y">
  <h3 class="nuda-a11y__title">Accessibility</h3>
  <div class="nuda-a11y__row">
    <div class="nuda-a11y__label">
      <span>Font size</span>
      <span class="nuda-a11y__val">16px</span>
    </div>
    <input class="nuda-a11y__slider" type="range" min="12" max="24"
           value="16" aria-label="Font size" />
  </div>
  <div class="nuda-a11y__row nuda-a11y__row--toggle">
    <div class="nuda-a11y__text">
      <span class="nuda-a11y__name">Reduce motion</span>
      <span class="nuda-a11y__desc">Minimize animations across the app.</span>
    </div>
    <label class="nuda-a11y__switch">
      <input type="checkbox" checked />
      <span></span>
    </label>
  </div>
</section>
CSS
/* Accessibility Section
   Font size slider + reduce motion toggle.
   Customize: --accent, --card-bg */

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

.nuda-a11y__title {
  margin: 0;
  color: #fafafa;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nuda-a11y__row {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.nuda-a11y__row--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nuda-a11y__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a0a0a8;
  font-size: 0.8125rem;
}

.nuda-a11y__val {
  color: #fafafa;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

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

.nuda-a11y__slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fafafa;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.nuda-a11y__slider:focus-visible::-webkit-slider-thumb {
  transform: scale(1.15);
}

.nuda-a11y__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

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

.nuda-a11y__desc {
  color: #a0a0a8;
  font-size: 0.75rem;
  line-height: 1.4;
}

.nuda-a11y__switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.nuda-a11y__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.nuda-a11y__switch span {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transition: background 0.25s ease;
}

.nuda-a11y__switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fafafa;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.nuda-a11y__switch input:checked + span {
  background: var(--accent);
}

.nuda-a11y__switch input:checked + span::after {
  transform: translateX(16px);
  background: #09090b;
}

@media (prefers-reduced-motion: reduce) {
  .nuda-a11y__slider::-webkit-slider-thumb,
  .nuda-a11y__switch span,
  .nuda-a11y__switch span::after {
    transition: none;
  }
}

How to use Accessibility Section

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