Component packs › Dials › Combo Lock

Combo Lock

Three number wheels roll past with a click per digit; the right code springs the shackle open, a wrong try shakes the lock.

Combo Lock is a combination input from Dials, a component pack with 8 components: Physical controls that click: dials, wheels, rings and switches with real detents. Price: $2 for the whole pack.

Built with: rolling wheels, spring shackle, spin buttons.

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.

Combo Lock props

PropTypeDefaultDescription
codestringThe code that opens it (three digits).
valuestring
theme'dark' | 'light'
soundboolean
hapticsboolean
autoplayboolean
onOpen() => void

Methods on the ref

Use it in React

import ComboLock from './ComboLock';

<ComboLock />

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

More in Dials

Good for: Knobs and dials.