Usage
ThemedSwitch is a compact sliding-track switch for two or three mutually exclusive options. Each option is icon-only and maps to a themed knob when active. With two options it renders a binary switch whose dimensions match the ui-core Switch exactly; with three options it renders a three-way toggle. The control always keeps one option selected and uses radio-group semantics under the hood.
Switch.SegmentedControl or Select.ToggleGroup.label for every option; labels become the accessible names because the control is icon-only.Icon morph tooling.knob of KnobType.Switch, Neutral, Success, or Error, driving the knob fill, including success and destructive gradients.ThemedSwitch matches the Switch track width, height, and thumb size exactly.prefers-reduced-motion: reduce.Do
ariaLabel or labelledBy on the root so the group purpose is announced.ThemedSwitchSize.Medium or Large for primary controls; pair distinct icons with knob themes.Don't
Small as the only size for high-frequency actions unless surrounding layout provides adequate target spacing.Each option exposes radio semantics; arrow keys move selection; names come from option labels. The component ships focus, contrast, reduced-motion, and forced-colors hardening for WCAG 2.2 AA. See Accessibility for the full contract, including target-size guidance.