Component packs › Keycap › Lock Key

Lock Key

Like an old caps lock key, it bottoms out and comes back only half way, latched, with the LED in the cap lit.

Lock Key is a checkbox from Keycap, a component pack with 6 keyboard controls: Controls made of mechanical keyboard keys: real travel, a tactile bump and a switch LED under every cap. Price: $2 for the whole pack.

Built with: latching travel, LED window in the cap, label click.

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.

Lock Key props

PropTypeDefaultDescription
checkedboolean
disabledboolean
labelstring"Remember this device"Text beside the key; also its accessible name. Default "Remember this device".
legendstring"Lock"Legend on the cap. Default "Lock".
onChange(checked: boolean) => void

Methods on the ref

Use it in React

import LockKey from './LockKey';

<LockKey />

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

More in Keycap

Good for: Buttons.