What's new Report an issue
GIG Cymru NHS Wales, Digital Health and Care Wales

Toggles

Two controls, one decision between them. A switch answers "is this on?"; a segmented control answers "which of these?". Both take effect immediately, so neither belongs in a form with a Save button.

Type: Switch

One setting, on or off. The off state has no label of its own — if you need to name it, you need the segmented control below.

<button type="button" role="switch" aria-checked="true" class="sr-switch">
  <span class="sr-switch__track"><span class="sr-switch__thumb"></span></span>
  <span class="sr-switch__label">Show archived requests</span>
</button>

The thumb's position, not only the track colour, carries the state — so it survives greyscale and low-vision viewing.

States. Default, and disabled in both positions. A disabled switch still announces whether it is on: "off and unavailable" is different information from "off".

Type: Segmented control

Two to four mutually exclusive views of the same screen, all labelled and all visible at once. Exactly one is selected at all times — there is no empty state.

<div class="sr-segmented" role="group" aria-label="Search mode">
  <button type="button" class="sr-segmented__option" aria-pressed="true">Quick search</button>
  <button type="button" class="sr-segmented__option" aria-pressed="false">Advanced</button>
</div>

States. Two options, three options, and the disabled control. Disabled-and-selected is a muted outline rather than a faded blue fill, because a greyed blue still reads as "on and available".


Two controls with one job between them: change what is on, or change which one. The Figma set groups them, so this page does too.


Which one

SwitchSegmented control
AnswersIs this on?Which of these?
OptionsTwo, and one of them has no labelTwo to four, every one labelled
Off stateImplied by the label being offNamed, like every other option
Use forA preference, a filter, showing or hidingA mode or a view, Quick search / Advanced

Both take effect immediately. Neither belongs in a form that is submitted, there, use a Checkbox or a Radio group, which wait for Save.


Type: Switch

When to use

When not to use

How it works


Type: Segmented control

When to use

When not to use

How it works


Do and don't

Accessibility

Content

Accessibility requirements

RequirementWCAG SCHow Single Record meets itTest method
Role and state are exposed4.1.2Switch is a real button with role="switch" and aria-checked; each segment is a button with aria-pressed inside a role="group". Both update in place so a change is re-announced.Screen reader announce, toggle
Exactly one segment is selected4.1.2The segmented control has no empty state; one option always carries aria-pressed="true", so the group never announces as "none selected".Screen reader, cycle options
Accessible name2.4.6The visible label names the setting; where no label is shown, aria-label is required.Screen reader announce
Operable from the keyboard2.1.1Tab to reach, Space or Enter to toggle — the native button behaviour, not re-implemented.Keyboard only
State not signalled by colour alone1.4.1Thumb position differs between on and off, and the label states what "on" means.Greyscale review
Target size2.5.8The 24px track is below the touch minimum on its own; touch layouts give the label-and-track control a 44px row.Measure, touch device
Focus visible2.4.7SR cyan ring around the track and around each segment, outside them so it is not clipped.Keyboard tab