Demo
- The label sits beside the switch and names the setting, never On or Off.
- Medium by default: 30 by 18 with a 14px thumb; the label extends the target.
Description
- A description says what changes when it is on; the switch sits at the end of the row.
Your nurse sees today's doses and notes. You can turn this off at any time.
Choice card
- The whole card is the label: a click anywhere toggles the switch.
- On cards get the light teal edge and tint, as the Radio group choice cards.
Disabled
- A disabled switch says why and how to turn it on, tied by aria-describedby.
Needs a camera check first. Call the clinic to set one up.
Invalid
- The Switch invalid example follows shadcn: the switch takes the red edge and a grey sentence under the label says what to do.
- The words carry the error, so it is never colour alone; the switch points to the sentence.
The care team needs them to plan your visits. Turn this on to continue.
Size
- Three sizes by thumb: Small 10px (22 by 14), Medium 14px (30 by 18), Large 16px (34 by 20); the thumb sits 2px from every edge.
- The label scales with the switch: 12, 14 and 16px.
- Medium is shadcn's default size; Large adds the doh-switch-lg class. Every size keeps the label as the larger target.