Component packs › Tactile › Mercury Switch

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.

Mercury Switch props

PropTypeDefaultDescription
checkedbooleanfalseInitial state. Default false.
disabledbooleanDisabled switches keep their state and turn matte.
labelstringAccessible name, e.g. "Wi-Fi". Required for screen readers.
sizenumberScale factor. 1 = 96 × 45 px.
onChange(checked: boolean) => voidCalled when the user toggles it (not when you call setChecked).
autoplaynumber | falseShowcase mode: toggles itself every N ms while visible.

Methods on the ref

Use it in React

import MercurySwitch from './MercurySwitch';

<MercurySwitch />

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

More in Tactile

Good for: Micro-interactions.