Component packs › Keycap › Keycap Button

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.

Keycap Button props

PropTypeDefaultDescription
labelstring"Deploy"Main legend. Default "Deploy".
substring"Enter"Small second legend on the cap. Default "Enter".
disabledboolean
onPress() => void
action() => unknownAsync work: the key stays down and lit until it settles.

Methods on the ref

Use it in React

import KeycapButton from './KeycapButton';

<KeycapButton />

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

More in Keycap

Good for: Buttons.