Keystroke Button
Web (React)
A keycap button with a key legend, a serif label and a hard bottom edge that sinks when pressed.
A keycap shaded from the card and muted tokens with a hard ink edge underneath. A mono key legend and a small primary status light sit in its top row above a serif label; a primary halo blooms on hover and the cap sinks 3px when pressed. Transitions are off when the user prefers reduced motion.
Installation
CLI
npx @modus-ui/cli add keystroke-buttonManual
- Install
framer-motion. - Copy the code from the component tab.
- Create a file at
components/ui/keystroke-button.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | "Commit changes" | Button text. |
keyHint | string | "⌘ S" | Key legend printed in the corner of the cap. |
onClick | MouseEventHandler<HTMLButtonElement> | undefined | Click handler. |
Comments