Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

SegmentedControl

A choice among a few neighboring options, always in view, that changes the view right away.

On this page

Playground

Options
Background
HTML
<div class="feitio-segmented" role="group" aria-label="Period"><button type="button" aria-pressed="true">Day</button><button type="button" aria-pressed="false">Night</button></div>

When to use

When not to use

Examples

Day and night

The buttons sit together in one box; the chosen one is in ink.

Show code
HTML
<span class="feitio-segmented" role="group" aria-label="Luz">
  <button type="button" aria-pressed="true">Auto</button>
  <button type="button" aria-pressed="false">Dia</button>
  <button type="button" aria-pressed="false">Noite</button>
</span>

Do and don’t

Do

Two short options that switch the view right away.

Don’t

Five long options: the box overflows on mobile. That is a Select.

Accessibility

Attributes

AttributeValuesWhat for
class="feitio-segmented"on the groupThe box with the options.
role="group", aria-labelrequiredThe group’s name, plain text only (no markup inside).
aria-pressed"true", "false"Which option is chosen.
Top