Component packs › Keycap › 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.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | ||
disabled | boolean | ||
label | string | "Remember this device" | Text beside the key; also its accessible name. Default "Remember this device". |
legend | string | "Lock" | Legend on the cap. Default "Lock". |
onChange | (checked: boolean) => void |
readonly checked: booleansetChecked(checked: boolean, silent?: boolean): voiddestroy(): voidimport LockKey from './LockKey';
<LockKey />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Buttons.