CodingLaboratory
Lab Commands
Enter The Lab

Component Lab / navigation-layout / segmented-control

Stable release
Back to category

Open experiment

Segmented view control

A small segmented control for changing density or view mode using native buttons and mutually exclusive aria-pressed states.

Lab tested Responsive Dark mode Interactive
Version
1.0.0
Updated
2026-08-02
Dependencies
Zero
Live canvasInstant token updates
Source filesEditable and export-ready
<div class="cmp-segmented" aria-label="Preview density">
  <button type="button" aria-pressed="true">Comfortable</button
  ><button type="button" aria-pressed="false">Compact</button
  ><button type="button" aria-pressed="false">List</button>
</div>
No runtime reactions detected Open in Editor

Validated in the lab

Experiment report

  • Schema and source files passed
  • Responsive test passed
  • Keyboard test passed
  • No console errors

Component ingredients

Dependencies
None
Browser support
Current Chrome, Current Edge, Current Firefox, Current Safari
Version
1.0.0
Last tested
2026-08-02

Accessibility notes

  • Every option is a native button.
  • Selected state uses aria-pressed.
  • Focus is visible.

License: MIT License for open-source use, modification, and distribution.