Switch
after Apple
An iOS 26-style switch whose thumb lifts into refracting glass on contact.
npx shadcn@latest add https://piruicy.com/r/switch.json
Details
- The canvas (320×180) overhangs the 222×84 track, so the lifted lens and its shadow never clip.
- On contact the thumb lifts to about 1.7×: clear in about 133ms, frosted again over about 230ms.
- Travel is critically damped (460/43; a tap 360/38); a drag follows the finger directly.
- Space and Enter toggle; without WebGL a plain CSS switch takes its place.
© 2026 Dhaval Khandhadia. Use it in anything you build; don’t resell it. MIT with the Commons Clause.