Mechanical Keyboard

Mechanical Keyboard

Full Mac keyboard with tactile depth-button keycaps — lifts on hover, snaps on press, plays synthesised mechanical click sounds via WebAudio.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/mechanical-keyboard.json

▸ Or install manually

  1. Copy the source from the Code tab above.
  2. Place it at components/mellow/mechanical-keyboard.tsx
  3. Import and use.

API Reference

PropTypeDefaultDescription
enableSoundbooleantruePlay WebAudio mechanical click sounds on press and release.
showPreviewbooleanfalseFloat key-legend ghosts above the board as keys are pressed.
variant"default" | "accent""default"default = themed ink glass. accent = purple keycaps.
keyDepthnumber3Height of the raised keycap block in pixels.
onKeyPress(code: string) => voidCallback fired on each key press with the KeyboardEvent.code value.
classNamestringAdditional CSS classes for the outer wrapper.