Component packs › Dune › Sand Switch
The thumb ploughs through a bed of real sand: grains bank up in front, spill over its top and settle behind it.
Sand Switch is a toggle from Dune, a component pack with 6 sand controls: Controls made of real sand: every grain falls, tumbles and piles up. Price: $2 for the whole pack.
Built with: falling sand engine, plough push, angle of repose.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | ||
disabled | boolean | ||
label | string | Accessible name, e.g. "Wi-Fi". | |
size | number | Scale factor. 1 = 112 × 44 px. | |
onChange | (checked: boolean) => void | ||
autoplay | number | false | Showcase mode: toggles itself every N ms while visible. |
readonly checked: booleansetChecked(checked: boolean, silent?: boolean): voiddestroy(): voidimport SandSwitch from './SandSwitch';
<SandSwitch />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Toggle switches, Loaders and progress, Physics UI components.