Component packs › Cogwork › Wind-up Button

Wind-up Button

Hold to wind: the key turns, the click drops tooth by tooth and the mainspring coils tighter; let go and the spring runs your action.

Wind-up Button is a hold to wind 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: visible mainspring, ratchet and click, runs on release.

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.

Wind-up Button props

PropTypeDefaultDescription
labelstringAccessible name and the action's name.
text{ idle?: string; winding?: string; running?: string; done?: string; short?: string }Status lines.
disabledboolean
onRun() => voidRuns when a wound spring is released.
theme'light' | 'dark'
autoplaynumber | falseShowcase mode: winds and releases every N ms while visible.

Methods on the ref

Use it in React

import WindUpButton from './WindUpButton';

<WindUpButton />

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

More in Cogwork

Good for: Skeuomorphic UI.