<!-- generated by scripts/gen-docs.mjs from docs/system/switch.md. Edit the source and rerun. -->
# Switch

## Description
A setting that takes effect the moment it flips, on or off, with nothing to save.

`import { Switch } from "@/components/cobalt/ui/switch"`, source `registry/cobalt/ui/switch.tsx`, status `ready-with-gaps`.
Foundation: `shadcn switch (base-luma, base)`. Traps checked: `trap/toggle-switch-submit` (Usage, `rule/switch-acts-at-once`), `trap/toggle-indeterminate` (n/a, a switch has two states and `rule/checkbox-select-all-mixed` covers the set case), `trap/control-height` (n/a, a 20px track inside a Label row, never beside a button at control height), `trap/focus-ring-shape` (States, focus-visible: the global outline follows the round track), `trap/hover-beats-focus` (State precedence: no hover style exists), `trap/disabled-still-hovers` (State precedence: disabled takes the not-allowed cursor and no colour change), `trap/weight-shift` (n/a, the track carries no text), `trap/motion-restart` (Motion: the thumb's transform transition reverses from where it is), `trap/motion-layout-property` (Motion: transform and colour only), `trap/reduced-motion-ignored` (Motion: the thumb jumps, the colour change stays), `trap/tabs-routes`, `trap/current-unmarked`, `trap/list-dead-gap` and `trap/narrow-hidden-nav` (n/a, Navigation traps for a control that neither navigates nor lists).

### Foundation
| Given by the foundation | Added by the team |
|---|---|
| Base UI `Switch.Root`, a focusable `<span role="switch">` with `aria-checked`, a hidden `<input type="checkbox">` that carries `name` to the form, `readOnly`, `required`, and Field wiring; `Switch.Thumb` | The `size` prop, `sm` (28 by 16) and `default` (44 by 20), on a `data-size` attribute both parts read; no hairline at rest; the off track filled with `--control-edge` (the foreground at 45 percent) and a transparent border, so it measures 3:1 on the page and on a card, and the on track the accent with its border in the same colour; the invalid hairline in `--destructive`; `touch-target` for a 72 by 48 hit area under a coarse pointer; the thumb white in both states (`--card` in the light, `--foreground` in the dark) with `shadow-glass`, slid on `duration-fade`, so the off switch is never brighter than the on one; the click stops at the switch so a clickable row does not also fire; no focus ring of its own, the global outline in `base.css` draws it The checked thumb travels to the end in right-to-left text (`rtl:` negative translate), where it ran out of the track before; the invalid edge is `--destructive` at full strength in the dark too (`docs/research/2026-10-16-break-ui-inputs.md`). |

## Examples
Settings that take effect the moment they flip, one per row with the switch at its end; a failed save moves the switch back and says so.

Real uses, 0 call sites (`rg -n "<Switch\b" app registry docs/system/examples --glob '!registry/cobalt/ui/*' --glob '!docs/system/examples/**'`): the showcase chrome has no setting that applies at once, and the examples folder does not count.

Uses inside the registry: none.

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/switch/default.tsx` | default | Settings that take effect the moment they flip, one per row with the switch at its end; a failed save moves the switch back and says so |
| `docs/system/examples/switch/size-default.tsx` | size=default | 44 by 20, for a setting in a list or a form |
| `docs/system/examples/switch/size-sm.tsx` | size=sm | 28 by 16, for a setting inside a dense row such as a table cell, named by aria-label where the row names it |
| Not applicable: size-default.tsx and two rows of default.tsx start on | state:checked | The accent track with the thumb at the end |
| `docs/system/examples/switch/state-disabled.tsx` | state:disabled | Off and on at half opacity, the words faded too, each saying why it cannot change |
| `docs/system/examples/switch/pending.tsx` | state:pending | Two-step sign-in applies only once the server accepts it, so the switch holds where it was put and the row says Saving until the answer; a refusal moves it back and says so |
| Not applicable: a switch acts the moment it flips, so no value waits to be checked; a yes that a form requires is a Checkbox, whose state-invalid.tsx shows it | state:invalid | A red edge on the track and the error under it |
| Not applicable: hover changes nothing on a switch, the cursor stays the default | state:hover | Nothing to show |
| Not applicable: focus-visible is reached with the keyboard on any example | state:focus-visible | The 2px outline 2px outside the round track |
| Not applicable: read-only looks like the rest state and is reached with `readOnly` | state:read-only | `aria-readonly` and no change on press |
| `docs/system/examples/switch/default.tsx` | composition:Label | One setting per row; the whole row toggles it |

Example: Settings that take effect the moment they flip, one per row with the switch at its end; a failed save moves the switch back and says so (`docs/system/examples/switch/default.tsx`)

```tsx
import { useRef, useState } from "react";

import { Label } from "@/components/cobalt/ui/label";
import { Switch } from "@/components/cobalt/ui/switch";
import { Presence, PresenceRow } from "@/lib/cobalt/presence";

// Stands in for your API call. It answers after 900ms, and fails while the browser is offline or the
// address has ?network=offline.
const request = () =>
  new Promise<void>((resolve, reject) =>
    setTimeout(() => {
      const offline = !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";
      if (offline) reject(new Error("offline"));
      else resolve();
    }, 900),
  );

// The switch answers at once and the save runs behind it. If the save fails, the switch moves back
// and a line grows in under it to say so, moving the rows below instead of jumping them. No spinner,
// no toast.
function Setting({ label, defaultChecked = false }: { label: string; defaultChecked?: boolean }) {
  const [checked, setChecked] = useState(defaultChecked);
  const [failed, setFailed] = useState<boolean | null>(null);
  const saved = useRef(defaultChecked);
  const latest = useRef(0);
  return (
    <div className="flex flex-col">
      <Label variant="row" className="justify-between">
        {label}
        <Switch
          checked={checked}
          onCheckedChange={(next) => {
            setChecked(next);
            setFailed(null);
            const run = ++latest.current;
            request().then(
              () => {
                saved.current = next;
              },
              () => {
                if (run !== latest.current) return;
                setChecked(saved.current);
                setFailed(next);
              },
            );
          }}
        />
      </Label>
      <Presence>
        {failed !== null && (
          <PresenceRow as="div" key="failed">
            <p role="alert" className="pb-2 text-sm text-destructive">
              {label} was not turned {failed ? "on" : "off"}. Check your connection and try again.
            </p>
          </PresenceRow>
        )}
      </Presence>
    </div>
  );
}

export default function Example() {
  return (
    <div className="flex w-full max-w-xs flex-col">
      <Setting label="Email me new filings" defaultChecked />
      <Setting label="Email me late filings" defaultChecked />
      <Setting label="Weekly digest" />
    </div>
  );
}
```

Example: One setting per row; the whole row toggles it (`docs/system/examples/switch/default.tsx`)

```tsx
import { useRef, useState } from "react";

import { Label } from "@/components/cobalt/ui/label";
import { Switch } from "@/components/cobalt/ui/switch";
import { Presence, PresenceRow } from "@/lib/cobalt/presence";

// Stands in for your API call. It answers after 900ms, and fails while the browser is offline or the
// address has ?network=offline.
const request = () =>
  new Promise<void>((resolve, reject) =>
    setTimeout(() => {
      const offline = !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";
      if (offline) reject(new Error("offline"));
      else resolve();
    }, 900),
  );

// The switch answers at once and the save runs behind it. If the save fails, the switch moves back
// and a line grows in under it to say so, moving the rows below instead of jumping them. No spinner,
// no toast.
function Setting({ label, defaultChecked = false }: { label: string; defaultChecked?: boolean }) {
  const [checked, setChecked] = useState(defaultChecked);
  const [failed, setFailed] = useState<boolean | null>(null);
  const saved = useRef(defaultChecked);
  const latest = useRef(0);
  return (
    <div className="flex flex-col">
      <Label variant="row" className="justify-between">
        {label}
        <Switch
          checked={checked}
          onCheckedChange={(next) => {
            setChecked(next);
            setFailed(null);
            const run = ++latest.current;
            request().then(
              () => {
                saved.current = next;
              },
              () => {
                if (run !== latest.current) return;
                setChecked(saved.current);
                setFailed(next);
              },
            );
          }}
        />
      </Label>
      <Presence>
        {failed !== null && (
          <PresenceRow as="div" key="failed">
            <p role="alert" className="pb-2 text-sm text-destructive">
              {label} was not turned {failed ? "on" : "off"}. Check your connection and try again.
            </p>
          </PresenceRow>
        )}
      </Presence>
    </div>
  );
}

export default function Example() {
  return (
    <div className="flex w-full max-w-xs flex-col">
      <Setting label="Email me new filings" defaultChecked />
      <Setting label="Email me late filings" defaultChecked />
      <Setting label="Weekly digest" />
    </div>
  );
}
```

## Variants

### size
- `default`: a 44 by 20 track with a 24 by 16 thumb, for a setting in a list or a form. Used at 0 call sites.
- `sm`: a 28 by 16 track with a 16 by 12 thumb, for a setting inside a dense row such as a table cell. Used at 0 call sites.

Example: 44 by 20, for a setting in a list or a form (`docs/system/examples/switch/size-default.tsx`)

```tsx
import { useState } from "react";

import { Label } from "@/components/cobalt/ui/label";
import { Switch } from "@/components/cobalt/ui/switch";

// Kept on this device, so it takes effect at once with nothing to save.
export default function Example() {
  const [compact, setCompact] = useState(true);
  return (
    <div className="w-full max-w-xs">
      <Label variant="row" className="justify-between">
        Compact rows on this device
        <Switch checked={compact} onCheckedChange={setCompact} />
      </Label>
    </div>
  );
}
```

Example: 28 by 16, for a setting inside a dense row such as a table cell, named by aria-label where the row names it (`docs/system/examples/switch/size-sm.tsx`)

```tsx
import { useState } from "react";

import { Switch } from "@/components/cobalt/ui/switch";

const rules = [
  { id: "northgate", fund: "Northgate Credit", form: "13F" },
  { id: "elm", fund: "Elm Street Value", form: "Form D" },
];

// Kept on this device, so each switch takes effect at once with nothing to save.
export default function Example() {
  const [on, setOn] = useState<Record<string, boolean>>({ northgate: true, elm: false });
  return (
    <ul className="flex w-full max-w-xs flex-col text-sm">
      {rules.map((rule) => (
        <li key={rule.id} className="flex min-h-10 items-center justify-between gap-3">
          <span className="min-w-0 truncate">
            {rule.fund} <span className="text-muted-foreground">{rule.form}</span>
          </span>
          <Switch
            size="sm"
            aria-label={`Alerts for ${rule.fund}`}
            checked={on[rule.id] ?? false}
            onCheckedChange={(next) => setOn((was) => ({ ...was, [rule.id]: next }))}
          />
        </li>
      ))}
    </ul>
  );
}
```

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| unchecked | render, or `checked={false}` | press, focus | the thumb at the start of the `--control-edge` track, `aria-checked="false"`, `data-unchecked` | test |
| checked | press, `defaultChecked` or `checked` | press to turn off | the thumb at the end of the track, `aria-checked="true"`, `data-checked` | test |
| hover | pointer over | press | nothing; the track has no hover style and the cursor stays the default | by hand |
| focus-visible | keyboard focus | press with Space | the 2px outline 2px outside the round track, from `base.css` | by hand |
| disabled | `disabled` | nothing; the switch leaves the tab order | half opacity from `data-disabled`, the not-allowed cursor, `aria-disabled="true"`; inside a Label the whole row fades to half once, the switch included, and the switch does not fade again (the label measured 1 before, `peer-disabled` never matched a wrapped switch; 0.5 effective after, Playwright 2026-10-17) | test |
| invalid | `aria-invalid` from `Field` or the host | press | the `--destructive` hairline on the track | test |
| read-only | `readOnly` | focus, read | `aria-readonly="true"`; a press changes nothing | by hand |
| pending | `pending` while the server takes the change | focus, read | the thumb where the person put it at full strength, `aria-busy="true"`, `aria-readonly="true"`, `data-pending` and the progress cursor; a press waits; the host writes the status word beside it | test |

Example: Off and on at half opacity, the words faded too, each saying why it cannot change (`docs/system/examples/switch/state-disabled.tsx`)

```tsx
import { Label } from "@/components/cobalt/ui/label";
import { Switch } from "@/components/cobalt/ui/switch";

export default function Example() {
  return (
    <div className="flex w-full max-w-xs flex-col">
      <Label variant="row" className="justify-between">
        <span className="flex min-w-0 flex-col gap-0.5">
          Early access
          <span className="text-muted-foreground">Opens in November</span>
        </span>
        <Switch disabled />
      </Label>
      <Label variant="row" className="justify-between">
        <span className="flex min-w-0 flex-col gap-0.5">
          Two factor sign in
          <span className="text-muted-foreground">Set by your organisation</span>
        </span>
        <Switch disabled defaultChecked />
      </Label>
    </div>
  );
}
```

Example: Two-step sign-in applies only once the server accepts it, so the switch holds where it was put and the row says Saving until the answer; a refusal moves it back and says so (`docs/system/examples/switch/pending.tsx`)

```tsx
import { useState } from "react";

import { Label } from "@/components/cobalt/ui/label";
import { Switch } from "@/components/cobalt/ui/switch";
import { TextSwap } from "@/components/cobalt/ui/text-swap";
import { useAction } from "@/lib/cobalt/use-action";

// Stands in for your API call. It answers after 1.2 seconds, and fails while the browser is offline
// or the address has ?network=offline.
const request = () =>
  new Promise<void>((resolve, reject) =>
    setTimeout(() => {
      const offline = !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";
      if (offline) reject(new Error("offline"));
      else resolve();
    }, 1200),
  );

export default function Example() {
  const [on, setOn] = useState(false);
  const save = useAction(async (next: boolean) => {
    try {
      await request();
    } catch (error) {
      setOn(!next);
      throw error;
    }
  });
  return (
    <div className="flex w-full max-w-xs flex-col">
      <Label variant="row" className="justify-between">
        {/* TextSwap trims its words to their capitals, so the gap is the 2px a description takes
            plus the room the trim takes away above the line. */}
        <span className="flex min-w-0 flex-col gap-1.5">
          Two-step sign-in
          {/* One line that is always there, so the words that come and go move nothing. */}
          <TextSwap
            show={save.status === "idle" ? "rest" : save.status}
            options={{
              rest: "A code at every new sign-in",
              pending: "Saving",
              success: on ? "On for your account" : "Off for your account",
              failure: "Not saved. Check your connection.",
            }}
            className="text-muted-foreground"
          />
        </span>
        <Switch
          checked={on}
          pending={save.status === "pending"}
          onCheckedChange={(next) => {
            setOn(next);
            void save.run(next);
          }}
        />
      </Label>
      <span role="status" className="sr-only">
        {save.status === "pending" ? "Saving" : save.status === "failure" ? "Not saved" : ""}
      </span>
    </div>
  );
}
```

### State precedence
- Disabled and hover: disabled wins. There is no hover style, and the cursor is not-allowed.
- Disabled and focus-visible: disabled wins. The switch leaves the tab order, so no outline shows.
- Disabled and checked: both show. The thumb stays at the end of the faded track so the value is still readable.
- Hover and focus-visible: focus-visible wins. Hover draws nothing, so the outline is the only change.
- Invalid and checked: both show. The accent track takes the red hairline, since a required switch can be invalid in either position.
- Invalid and disabled: disabled wins. A disabled control inside an invalid form shows no error of its own.
- Read-only and focus-visible: both show. The switch takes focus and the outline, and a press changes nothing.
- Checked and unchecked: Not applicable: a switch is one or the other, there is no mixed state.

### Motion
| Trigger | Kind | Preset | Properties | Reduced motion |
|---|---|---|---|---|
| off to on, and back | announce | `duration-fade` (`--t-fade`, 150ms) on `--curve` | transform on the thumb (16px on the default size, 8px on `sm`), background-color and border-color on the track | the thumb jumps and the track colour still fades; `base.css` drops transforms and keeps colour |
| pointer over and out | announce | none | nothing changes | nothing |

## Props

<!-- Props generated from registry/cobalt/ui/switch.tsx with TypeScript by scripts/props-table.mjs -->
| Prop | Type | Default | Purpose |
|---|---|---|---|
| `pending?` | `boolean` | `false` | The change is saving: presses wait and the switch says it is busy, without fading. |
| `size?` | `"default" \| "sm"` | `"default"` | `default` a 44 by 20 track with a 24 by 16 thumb; `sm` a 28 by 16 track with a 16 by 12 thumb. |

Also accepts every native `<span>` attribute; from Base UI: `checked`, `defaultChecked`, `disabled`, `form`, `id`, `inputRef`, `name`, `nativeButton`, `onCheckedChange`, `readOnly`, `render`, `required`, `uncheckedValue`, `value`.

Every Base UI `Switch.Root` prop passes through: `checked`, `defaultChecked`, `onCheckedChange`, `disabled`, `readOnly`, `required`, `name`, `value`, `inputRef`, `aria-*`. `size` is the team's, `sm` or `default`. `pending` is the team's: the change is saving, so presses wait and the switch reads busy without fading. `className` is merged last and is for placement. `onClick` still fires after the switch stops the event, so a row that holds it does not also toggle.

## Usage

### When to use
- You turn a setting on or off and it applies at once: notifications, sounds, a theme, sharing.
- A row in a settings list holds one such setting, the word first and the switch at the end.

### When not to use
- The change applies only when the form is saved. Use Checkbox instead.
- Exactly one of a few options may be chosen. Use SegmentedControl instead.
- The on state is a filter in a row of chips, or a button that stays pressed. Use Pill or Toggle instead.

### Rules
- `rule/switch-acts-at-once`: When a setting flips, apply it in `onCheckedChange` and never behind a Save button, and when the form must be saved first use Checkbox instead, because the switch role promises the change on the flip. Evidence: principle platform: the WAI-ARIA switch pattern and the iOS switch act at once, and the native checkbox is a form value. Check: review of every Switch inside a form with a submit button.
  - Don't: `<form><Label><Switch name="sounds" /> Sounds</Label><Button type="submit">Save</Button></form>`
  - Do: `<Label><Switch checked={sounds} onCheckedChange={saveSounds} /> Sounds</Label>`
- `rule/switch-in-label`: When a switch has a word beside it, put the switch and the word inside one `Label` instead of a `div` with text, because the word becomes the accessible name and the whole row becomes the hit area. Evidence: principle wcag: 4.1.2 Name, role, value, a switch with no name is announced as "switch" alone; principle platform: a label's click activates the control it wraps. Check: lint trap/label-unbound (scripts/check-system.mjs); review.
  - Don't: `<div className="flex justify-between"><span>Sounds</span><Switch /></div>`
  - Do: `<Label className="justify-between">Sounds<Switch /></Label>`
- `rule/switch-pending-while-saving`: When the server must accept a setting before it applies, move the switch at once, pass `pending` while it saves and write the status word beside it, instead of holding the thumb until the server answers or fading it with `disabled`, because a thumb that moves late reads as a refusal and a faded one reads as unavailable. Evidence: principle heuristic: visibility of system status, the state is told beside the control, not by undoing the press; single use docs/system/examples/switch/pending.tsx:50-52. Check: test `switch.test.tsx` "pending keeps the thumb where it was"; review.
  - Don't: `<Switch checked={serverValue} disabled={saving} onCheckedChange={(on) => post(on)} />`
  - Do: `<Switch checked={on} pending={saving} onCheckedChange={(next) => { setOn(next); save(next); }} />` with "Saving" beside it
- `rule/switch-small-only-in-rows`: When the switch sits inside a row at `--row` (40px) or less, such as a table cell, use `size="sm"`, and everywhere else the default, because on `sm` the thumb is 12px and the on and off positions are 8px apart, half the default's 16px. Evidence: measured tracks of 44 by 20 and 28 by 16 at 390, .design-system/evidence/switch/colors-390.json; principle wcag: 2.5.8 Target size (minimum), 24px, met by the 72 by 48 coarse-pointer hit area on both sizes. Check: review.
  - Don't: `<Label><Switch size="sm" /> Notifications</Label>` in a settings list
  - Do: `<Label><Switch /> Notifications</Label>` in the list, `size="sm"` only in the table cell
- `rule/switch-value-through-name`: When the switch belongs to a form that submits, give it `name` instead of mirroring it into state for the submit handler alone, because the hidden `<input type="checkbox">` already carries it in the form data. Evidence: principle platform: the native checkbox submits `name` when on and nothing when off, and the hidden input in the markup carries it. Check: test `switch.test.tsx` "carries its value to the form"; review.
  - Don't: `<Switch checked={digest} onCheckedChange={setDigest} />` with `onSubmit={() => post({ digest })}`
  - Do: `<Switch name="digest" defaultChecked={digest} />`

### Content
- Follows `rule/writing-field-label-noun`.
- `rule/switch-label-names-the-thing`: When the label is written, it names the thing that is on, a noun phrase in sentence case such as "Notifications" or "Weekly digest", with no "Enable" or "Turn on" and no "On" or "Off" written beside the switch, because the switch already says on or off and a verb makes the row read as a button. Evidence: person D11; principle heuristic: match between system and the real world, the row names the setting. Check: lint copy/casing on the field-label slot (scripts/copy-check.mjs); review.
  - Don't: `<Label><Switch /> Enable notifications (Off)</Label>`
  - Do: `<Label><Switch /> Notifications</Label>`

### Anti-slop
- `rule/switch-no-green-track`: When an agent paints the on track green or the off track red, keep the accent for on and the `--control-edge` fill for off, because good and bad are for data, and a selected state is one colour everywhere. Evidence: person D13. Check: lint rule/component-override on Switch (scripts/check-system.mjs); lint rule/palette-use.
  - Don't: `<Switch className="data-checked:bg-good" />`
  - Do: `<Switch />`
- `rule/switch-no-glyph-in-thumb`: When an agent puts a check or a cross inside the thumb, leave the thumb of `Switch` plain and pass no `className` for it, because the thumb is 16px, the track colour and the thumb's position already say on, and a glyph would need its own transition. Evidence: principle heuristic: aesthetic and minimalist design, one cue per state; person D13. Check: lint rule/component-override on Switch (scripts/check-system.mjs); review.
  - Don't: `<Switch className="[&_[data-slot=switch-thumb]]:bg-[url(/check.svg)]" />`
  - Do: `<Switch />`

### Limits
- Not applicable: the track is fixed at 44 by 20 or 28 by 16 and the label wraps inside the Label row, so no count, length or width breaks it; there is nothing to grow and measure.

## Accessibility
Rests on Base UI `Switch.Root`: a focusable `<span role="switch">` with a hidden native `<input type="checkbox">` beside it for the form.

Contrast, measured on the showcase on 16 October 2026 (.design-system/tmp/fix-actions/contrast.mjs): the off track 3.15:1 on a card and 3.1:1 on the page in the light, 4.36:1 on both in the dark, which passes the 3:1 of WCAG 1.4.11 Non-text contrast; the thumb on the off track 3.15:1 light and 3.94:1 dark; the on track against the page 5.66:1 light and 7.91:1 dark; the thumb on the on track 6.07:1 light and 2.4:1 dark. In the dark the white thumb on the light accent is under 3:1, and the state still reads from the track against the page and the thumb's position.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before the switch | focuses it and shows the outline | the switch | by hand |
| Space | the switch | toggles it and fires `onCheckedChange` | the switch | by hand |
| Enter | the switch | toggles it through Base UI's button handling | the switch | by hand |
| Tab | a disabled switch | skips it; the switch carries `tabindex="-1"` | the next control | test |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| root | switch | the wrapping `Label`, or `aria-label` or `aria-labelledby` from the host | `aria-checked`, `aria-disabled`, `aria-readonly`, `aria-required`, `aria-invalid` from Field | the name, "switch", and on or off; the change on each press | test |
| thumb | none | none | `data-checked` or `data-unchecked` for the slide | nothing | test |
| hidden input | none | none, `aria-hidden` | `name`, `checked`, `disabled` for the form | nothing | test |

## Tokens
| Part | State | Token |
|---|---|---|
| root | all | `--t-fade`, `--curve`, `--touch`, `--ring`, `--line-focus`, `--focus-offset` |
| root | unchecked | `--control-edge` |
| root | checked | `--primary` |
| root | invalid | `--destructive`, at 50 percent in the dark |
| thumb | all | `--card` in the light, `--foreground` in the dark, `--elev-glass` through `shadow-glass` |

## Related
- Checkbox: a choice that applies when the form is saved.
- SegmentedControl: exactly one of a few options.
- Pill: a filter that is on or off.
- Toggle: a button that stays pressed.
- Field: the Label that wraps the switch with its word, and the row that toggles it.
- Select: picks one of up to 10 known options from a list that opens on demand.
- RadioGroup: exactly one choice among a few, saved with a form.
- SaveToggle: keeps a thing for later, a bookmark that fills.
