Component packs › Dune › Sand Switch

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.

Sand Switch props

PropTypeDefaultDescription
checkedboolean
disabledboolean
labelstringAccessible name, e.g. "Wi-Fi".
sizenumberScale factor. 1 = 112 × 44 px.
onChange(checked: boolean) => void
autoplaynumber | falseShowcase mode: toggles itself every N ms while visible.

Methods on the ref

Use it in React

import SandSwitch from './SandSwitch';

<SandSwitch />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Dune

Good for: Toggle switches, Loaders and progress, Physics UI components.