Kodza

Segmented Control

Two to five exclusive choices on real radio buttons. An ink pill slides to the one you pick, stretching on the way, and the labels turn white exactly at its edges.

Forms No dependencies segmented controltoggleradiopricing toggleform Added Nov 2026
/anim/segmented-control/ GitHub Fullscreen

With your AI

Just ask.

Say it to your AI. It gets the exact code below, not its best guess, and knows where it goes.

Add the Kodza Segmented Control to my page.

Not plugged in yet?
claude mcp add -t http kodza https://kodza.dev/api/mcp
Also in Codex, Cursor and VS Code.
kodza-segmented-control.html
<fieldset class="kodza-segmented">
  <legend class="kodza-segmented__legend kodza-segmented__legend--hidden">Billing</legend>
  <div class="kodza-segmented__track">
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="billing" value="monthly" checked>
      <span class="kodza-segmented__label">Monthly</span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="billing" value="annual">
      <span class="kodza-segmented__label">Annual <span class="kodza-segmented__badge">−20%</span></span>
    </label>
  </div>
</fieldset>

<fieldset class="kodza-segmented kodza-segmented--icons">
  <legend class="kodza-segmented__legend kodza-segmented__legend--hidden">View</legend>
  <div class="kodza-segmented__track">
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="view" value="list" checked>
      <span class="kodza-segmented__label">
        <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M4 6.5h16M4 12h16M4 17.5h16"/></svg>
        <span class="kodza-segmented__name">List</span>
      </span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="view" value="grid">
      <span class="kodza-segmented__label">
        <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="6.5" height="6.5" rx="1.5"/><rect x="13.5" y="4" width="6.5" height="6.5" rx="1.5"/><rect x="4" y="13.5" width="6.5" height="6.5" rx="1.5"/><rect x="13.5" y="13.5" width="6.5" height="6.5" rx="1.5"/></svg>
        <span class="kodza-segmented__name">Grid</span>
      </span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="view" value="board">
      <span class="kodza-segmented__label">
        <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round" aria-hidden="true"><rect x="4" y="4" width="4.5" height="16" rx="1.5"/><rect x="9.75" y="4" width="4.5" height="11" rx="1.5"/><rect x="15.5" y="4" width="4.5" height="7" rx="1.5"/></svg>
        <span class="kodza-segmented__name">Board</span>
      </span>
    </label>
  </div>
</fieldset>

<fieldset class="kodza-segmented kodza-segmented--block">
  <legend class="kodza-segmented__legend">Size</legend>
  <div class="kodza-segmented__track">
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="size" value="xs">
      <span class="kodza-segmented__label">XS</span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="size" value="s">
      <span class="kodza-segmented__label">S</span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="size" value="m" checked>
      <span class="kodza-segmented__label">M</span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="size" value="l">
      <span class="kodza-segmented__label">L</span>
    </label>
    <label class="kodza-segmented__option">
      <input class="kodza-segmented__input" type="radio" name="size" value="xl" disabled>
      <span class="kodza-segmented__label">XL</span>
    </label>
  </div>
</fieldset>

Checked

Checked before you paste.

Robots poked at it before you did. Every component goes through the same checks, and again each time it changes.

What ranLast run
Accessibilityaxe-core 4.10.2: the WCAG 2.1 A and AA rules, plus best practices. 0 issues
KeyboardThe Tab key gets there, and the focus ring shows when it does. Passed
Reduced motionTurn on reduced motion and what moved just appears. Nothing loops. Passed
Light and darkThe same checks on both themes, contrast included. Passed
WordPressPasted into Twenty Twenty-Five, Twenty Twenty-One, Astra, Blocksy, GeneratePress, Hello Elementor, Kadence and OceanWP. Nothing to flag. 8 / 8 themes
Robots checked this. A human with VoiceOver hasn't yet.
KeyboardPress them in the preview
On an option
  • Picks the next option, round and round→/↓
  • Picks the previous option, round and round←/↑

More like this

More in Forms