Sleepy Blob Switch
betaA switch whose knob is a sleepy blob: it wakes, hops across with a squash and a stretch, and smiles as the track warms.
- Forms
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add sleepy-blob-switchnpm packages installed: class-variance-authority, radix-ui.
import { SleepyBlobSwitch } from "@/components/ui/sleepy-blob-switch";Default
Stage
Sizes
<SleepyBlobSwitch>
| Prop | Type | Default |
|---|---|---|
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 is aria-hidden decoration with no visible label, so name it with aria-label or a <label>. The knob's position carries the state, not colour. The hop only plays after a toggle; under reduced motion the blob jumps and its breathing and drifting "z" 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