Segmented
A radio group that reads as one solid control.
How to use it
Copy any example below and paste it in- Markup
.segmentedaround labels, each with ansr-onlyradio and a<span>.- Why radios
- The options are mutually exclusive, and a radio group is what tells a screen reader so. Three buttons do not.
- The legend
- Give the fieldset an
sr-onlylegend, or the group has no name.
Date range
<fieldset class="segmented">
<legend class="sr-only">Date range</legend>
<label>
<input type="radio" name="demo-range" value="14" checked>
<span>14 D</span>
</label>
<label>
<input type="radio" name="demo-range" value="30">
<span>30 D</span>
</label>
<label>
<input type="radio" name="demo-range" value="90">
<span>3 M</span>
</label>
</fieldset>