Reactor Switch
betaA switch drawn as an armoured power core that slides across, lights its cells one by one and crackles with current.
- Forms
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add reactor-switchnpm packages installed: class-variance-authority, radix-ui.
import { ReactorSwitch } from "@/components/ui/reactor-switch";Default
Readout
Stage
Sizes
<ReactorSwitch>
| Prop | Type | Default |
|---|---|---|
readoutShow a "CHARGING 64%" line above the track that counts as the core charges. | boolean | false |
size | "sm" | "md" | "lg" | "md" |
Every prop of Radix UI’s Switch.Root, plus className.
Built on the Radix switch primitive: role="switch" with aria-checked, toggled by click, Space or Enter, with a focus ring and a hidden input inside forms. The artwork and the optional `readout` line are aria-hidden; name the switch with aria-label or a <label>. The core's position carries the state, not colour. Under reduced motion the core jumps, the readout jumps to its value, and the current and sparks stop. The scene never mirrors in right-to-left layouts.
7/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — fails
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes