Skip to content

Kitchen Sink

Body text. The quick brown fox jumps over the lazy dog. This is a paragraph demonstrating the base typographic style — Lilex Variable throughout, with lighter weight for headings and display numbers.

Bold text and italic text and strikethrough text and inline code and a link to somewhere.

Blockquote. Design is not just what it looks like and feels like. Design is how it works.

— Steve Jobs


  • First item
  • Second item
    • Nested item
    • Another nested item
  • Third item
  1. First step
  2. Second step
    1. Sub-step one
    2. Sub-step two
  3. Third step

key : The value returned by KeyboardEvent.key. This is what hotter-keys matches on.

code : The physical key position. Layout-dependent — do not use.


Inline: createHotkeys({ target: document.body })

basic-usage.ts
import { createHotkeys } from "@hotter-keys/core";
const hk = createHotkeys({ target: document.body });
// Single shortcut
hk.add("ctrl+k", () => {
console.log("Command palette opened");
});
// Key sequence (chord)
hk.add("ctrl+k ctrl+c", () => {
console.log("Comment block");
});
// Held-keys tracking
hk.onHeldKeysChange((keys) => {
console.log("Currently held:", keys);
});
theme-tokens.css
:root {
--hk-card-bg: #e4e4da;
--hk-card-border: rgba(26, 26, 23, 0.1);
--hk-rule: rgba(26, 26, 23, 0.07);
--hk-danger: #c45040;
}
keymap.json
{
"entries": [
{ "name": "save", "shortcut": "ctrl+s" },
{ "name": "undo", "shortcut": "ctrl+z" }
]
}

PropertyTypeDefaultDescription
targetHTMLElementThe element to listen on
timeoutnumber1000Sequence timeout in ms
suppressbooleantruePrevent default on match

A wider table:

KeyCodekeyCodeDeprecatedLayout-awareSafe
aKeyA65NoYesYes
ArrowUpArrowUp38NoN/AYes
AltAltLeft18NoN/ANo


Inline badges: New Deprecated Beta Note Default Tip

Sizes: Small Medium Large


Safe by default

Matches on event.key, not event.code — works across all keyboard layouts.

Key sequences

Multi-chord shortcuts like Ctrl+K Ctrl+C with configurable timeout.

Held-keys tracking

Real-time tracking of which keys are currently pressed.

Shortcut recording

Built-in recordShortcut() utility with safety validation.





Placeholder


Expand to see raw keymap JSON
{
"entries": [
{ "id": "1", "name": "save", "description": "Save file", "shortcut": "ctrl+s" },
{ "id": "2", "name": "undo", "description": "Undo last action", "shortcut": "ctrl+z" },
{ "id": "3", "name": "comment", "description": "Toggle comment", "shortcut": "ctrl+k ctrl+c" }
]
}

Press Ctrl + K then Ctrl + C to comment a block.

The API uses HTML keyboard events.

This is small text, useful for footnotes or fine print.

E = mc2 and H2O.


A standalone gauge at different values:

0360 keys
0362 keys
0364 keys
0366 keys
0fired
7fired
42fired
128total