Components · Forms

Selection controls

Choosing between a checkbox, a radio and a switch: how many may be chosen, and when the choice takes effect.

Stable · v1.0 shadcn/ui WCAG 2.2 AA

Overview

The three are documented separately — Checkbox, Radio and Switch — and ship as three items over one shared base file. What is left here is the question that comes before all of them, and the rules that apply to whichever one you land on. This page ships no component of its own.

The three are distinguished by two questions: how many may be chosen, and when the choice takes effect. Answering those consistently is most of what this page is for.

ControlChooseTakes effectUse for
CheckboxZero or more, independently On submitFilters, opt-ins, multi-select in a form
RadioExactly one, from a visible set On submitMutually exclusive options where seeing them all matters
SwitchOn or off ImmediatelyA setting that applies the moment it is flipped
A switch acts; a checkbox proposes

The distinction is not cosmetic. A switch changes system behaviour the instant it moves, with no confirmation step — which makes it right for "show model annotation" and wrong for anything that belongs in a submitted record. If the change should be reviewable before it counts, it is a checkbox in a form, not a switch. Using a switch for a recorded clinical value removes the moment at which a clinician would notice a mistake.

Honest about timing

The control's shape tells the clinician whether the change has already happened. That promise is never broken for layout convenience.

Never pre-decided

No clinical option is selected on the clinician's behalf — the same rule as Select.

Labelled by meaning

The label states what selecting does, not what the field is called internally. The whole label is the target.

Anatomy

Checkbox · radio · switch
Include in export ✓ ECG traces – Laboratory results 2 of 4 selected ✓ Clinician notes ✓ Prior admissions Available once records are linked
Sampling interval ● 0/1 h algorithm ● 0/3 h algorithm ● Local protocol
Show model annotation Applies immediately Audible alarms Applies immediately

Rules

Do's and don'ts

The pairs moved to the control they are about: Checkbox, Radio and Switch.

Accessibility

Outcomes of use

Clinical safety notes

Risk controls carried by this set

Trace these in your risk file (ISO 14971) and usability engineering file (IEC 62366-1). Each control's own page carries the controls specific to it.

NotJustAnyMed.Tech Design System · Selection controls · v1.0 · draft for review
Covers Checkbox, Radio and Switch. Reference applications named in this system are fictional.