Component packs › Keycap › Keycap Button
It sinks under your finger, sticks at the tactile bump, bottoms out and lights the plate; it stays down and lit while your action runs.
Keycap Button is a button 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: tactile travel curve, switch LED spill, async hold.
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 |
|---|---|---|---|
label | string | "Deploy" | Main legend. Default "Deploy". |
sub | string | "Enter" | Small second legend on the cap. Default "Enter". |
disabled | boolean | ||
onPress | () => void | ||
action | () => unknown | Async work: the key stays down and lit until it settles. |
readonly busy: booleanpress(): Promise<void>destroy(): voidimport KeycapButton from './KeycapButton';
<KeycapButton />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Buttons.