keyboard.js
The tiny keyboard library. keyboard.js ships hotkeys, key sequences (g g), chords (j+k), stackable named scopes, layout remap (Dvorak/Colemak), and a record + replay engine — everything a web app will ever need from the keyboard — in 3.2KB gzipped with zero runtime dependencies. TypeScript-first, MIT licensed.
The Problem
Challenge
Every web app needs keyboard shortcuts, but the existing options force a trade-off: hotkeys-js is tiny but can't do sequences or chords, Mousetrap handles sequences but not chords or stackable scopes, and neither offers layout remapping or macro recording. When a product matures — command palettes, Vim-style navigation, modal scopes, Dvorak users, QA replay — teams end up writing fragile custom code on top of raw keydown listeners. There was no single library that covered the full keyboard story while staying small, typed, and framework-agnostic.
Our Approach
Strategy
We built keyboard.js from scratch in TypeScript with a singleton API (`Kb`) that unifies every pattern under one mental model. Hotkeys resolve modifiers cross-platform (`mod` → Cmd on Mac, Ctrl on Windows/Linux). Sequences track inter-key timing with a configurable window. Chords detect simultaneous keydowns. Named scopes stack and can be marked exclusive to suppress globals while modals are open. Layout remap translates physical keys through Dvorak/Colemak/QWERTY tables. The recorder captures frame-accurate key timelines and replays them at arbitrary speed — ideal for macros, tests, and onboarding tours. The landing page is a self-hosting showcase: a live keyboard visualizer that lights up pressed keys, interactive cards demonstrating each binding type, a fully playable Snake game, a Vim-style command palette, a Konami easter egg, and a recorder demo.
The Solution
Result
A production-ready, MIT-licensed keyboard library at 3.2KB gzipped with zero runtime dependencies. Ships UMD for one-tag CDN usage and ESM + full TypeScript declarations for bundlers. Six core capabilities (hotkeys, sequences, chords, scopes, layouts, recorder) behind a consistent `Kb.on / Kb.chord / Kb.pushScope / Kb.record` API. Deployed on Vercel at keyboardjs.techzunction.com with a documentation site that doubles as a live playground — every feature runs in the browser against real keypresses.
Screenshots
Product Gallery





Live Demos
See It in Action
Key Metrics
Gzipped
Dependencies
Core Features
License
Get This Product
keyboard.js
Complete source code, assets, and deployment-ready build
Exclusive Ownership
Secure payment via Razorpay. Instant delivery.
Next Product
keyboard.js
$10