Buttons
Live keycap
Live keycap: A physical looking keycap that presses down when clicked and mirrors the matching key on the reader's real keyboard.
Using Live keycap
Live keycap uses the inline preview frame with a light/dark theme setting.
Customize the preview
These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.
| Control | Type | Default | Preview limits |
|---|---|---|---|
keyLabel | text | Alt | Up to 8 characters |
accent | color | #38BDF8 | No additional limit in the metadata. |
travel | number | 2 | From 1 to 6; step 1 |
watchKeyboard | boolean | true | No additional limit in the metadata. |
tone | select | light | Options: light, dark |
Which frameworks are available for Live keycap?
Live keycap is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.
What does Live keycap depend on?
The React metadata lists no additional npm dependencies beyond React.
What accessibility details are visible in Live keycap?
The React source for Live keycap includes: native elements (button); attributes and handlers (onKeyDown, onKeyUp); key comparisons (Enter, Space). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.
How does Live keycap handle reduced motion?
Live keycap reads the motion preference in its React source through matchMedia(prefers-reduced-motion). Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.