Component packs › Tactile › Mercury Switch
The bead necks, pinches into two droplets that race across and merge again with a splash.
Mercury Switch is a toggle from Tactile, a component pack with 6 components: Controls that behave like real materials. Price: $2 for the whole pack.
Built with: goo merge, squash & stretch, cursor-reactive chrome.
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 | false | Initial state. Default false. |
disabled | boolean | Disabled switches keep their state and turn matte. | |
label | string | Accessible name, e.g. "Wi-Fi". Required for screen readers. | |
size | number | Scale factor. 1 = 96 × 45 px. | |
onChange | (checked: boolean) => void | Called when the user toggles it (not when you call setChecked). | |
autoplay | number | false | Showcase mode: toggles itself every N ms while visible. |
readonly checked: booleansetChecked(checked: boolean, silent?: boolean): voidsetDisabled(disabled: boolean): voiddestroy(): voidimport MercurySwitch from './MercurySwitch';
<MercurySwitch />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Micro-interactions.