Component packs › Cogwork › Gear Toggle

Gear Toggle

The thumb is a pinion rolling along a toothed rack, turning exactly as far as it travels and staying in mesh the whole way.

Gear Toggle is a toggle from Cogwork, a component pack with 6 clockwork controls: Controls run by real gears: they mesh, wind, tick and ratchet. Price: $2 for the whole pack.

Built with: rack and pinion, no-slip roll, steel to copper.

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.

Gear Toggle props

PropTypeDefaultDescription
checkedboolean
disabledboolean
labelstringAccessible name.
onChange(checked: boolean) => void
theme'light' | 'dark'
autoplaynumber | falseShowcase mode: toggles itself every N ms while visible.

Methods on the ref

Use it in React

import GearToggle from './GearToggle';

<GearToggle />

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

More in Cogwork

Good for: Skeuomorphic UI.