Mechanical Keyboard: Interactive Simulator

A browser-based mechanical keyboard with real switch sounds, several keycap colorways, haptics on mobile, and a volume slider. Built with React and the HTML5 Audio Context API.

Mechanical Keyboard: Interactive SimulatorClick to zoom
Timeline

2 Weeks

Role

Frontend & Audio Engineer

Team

Solo

Status
Completed

Technology Stack

React
TypeScript
Vite
Tailwind CSS
Lucide Icons
Web Haptics API
HTML5 Audio Context

Key Challenges

  • Low-Latency Sound Mapping with HTML5 Audio Context
  • High-Fidelity Responsive Keyboard Grid Layout
  • Mobile Vibration and Tactile Haptics Syncing

Key Learnings

  • Audio Buffering & Prefetching in React
  • Web Haptics integration for mobile tactile feeling
  • Handling simultaneous hardware and touch events

Mechanical Keyboard Simulator

An interactive, high-fidelity mechanical keyboard simulator built with React, TypeScript, and Tailwind CSS. The app lets users explore different mechanical switch sounds (clicky, tactile, linear), swap keycap colorways, and get a tactile experience directly in the browser.

I built it because I couldn’t decide between keycap sets without hearing the switches, and there wasn’t a single tool that did both.


Key features

  • Interactive virtual layout. A fully interactive, responsive QWERTY layout matching standard 60%/65% mechanical keyboards.
  • Realistic audio engine. Uses the HTML5 Audio Context to pre-decode and stream switch clacks, minimizing trigger latency.
  • Aesthetic keycap themes. Swap between multiple colorways: Classic, Mint, Royal, Dolch, Sand, Scarlet.
  • Tactile haptic feedback. Uses web-haptics to deliver vibration on compatible mobile browsers.
  • Dual input mapping. Highlights virtual keycaps on physical keyboard keydown events while supporting touch and click.

Tech stack and architecture

  • Core. React 19, TypeScript, Vite.
  • Audio engine. HTML5 AudioContext, Web Audio API buffers.
  • Styling. Tailwind CSS (utility classes, flex/grid layouts, responsive scaling).
  • Haptics. Native Vibration API with fallback wrappers.
  • Icons. Lucide React.
"You have a right to perform your prescribed duty, but you are not entitled to the fruits of actions."
Bhagavad Gita

Design by SahilCodex
© 2026. Built with hands.