Skip to content

Commit a093048

Browse files
ryan-williamsclaude
andcommitted
Add mktoc-generated TOC with vanity heading IDs
H2+H3 entries for Quick Start and Motivation sections, H2-only from Core Concepts onward for a compact TOC. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dbfd191 commit a093048

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ Keyboard-navigation and -control for the web: omnibars, editable hotkeys, search
66

77
Documentation & Demos: [kbd.rbw.sh]
88

9-
## Quick Start
9+
<!-- `toc` -->
10+
- [Quick Start](#quick-start)
11+
- [Basic steps](#basic-steps)
12+
- [Motivation / Examples](#motivation)
13+
- [Usage in the wild](#usage)
14+
- [Comparison](#comparison)
15+
- [Inspiration](#inspiration)
16+
- [Core Concepts](#concepts)
17+
- [Components](#components)
18+
- [Styling](#styling)
19+
- [Mobile Support](#mobile)
20+
- [Patterns](#patterns)
21+
- [Low-Level Hooks](#hooks)
22+
- [Debugging](#debugging)
23+
- [License](#license)
24+
25+
## Quick Start <a id="quick-start"></a>
1026

1127
```bash
1228
npm install use-kbd # or: pnpm add use-kbd
@@ -15,7 +31,7 @@ npm install use-kbd # or: pnpm add use-kbd
1531
or install latest GitHub [`dist` branch] commit width [`pds`]:
1632

1733
```bash
18-
pds init runsascoded/use-kbd
34+
pds init -H runsascoded/use-kbd
1935
```
2036

2137
[`dist` branch]: ./tree/dist
@@ -52,7 +68,7 @@ function Dashboard() {
5268
}
5369
```
5470

55-
### Basic steps
71+
### Basic steps <a id="basic-steps"></a>
5672

5773
1. **Drop-in UI components**:
5874
- `ShortcutsModal`: view/edit key-bindings
@@ -62,9 +78,9 @@ function Dashboard() {
6278
2. **Register functions as "actions"** with `useAction`
6379
3. **Easy theming** with CSS variables
6480

65-
## Motivation / Examples
81+
## Motivation / Examples <a id="motivation"></a>
6682

67-
### Usage in the wild
83+
### Usage in the wild <a id="usage"></a>
6884

6985
- [ctbk.dev] ([GitHub][ctbk-gh] · [usage][ctbk-usage] · [diff][ctbk-diff]) — Citi Bike trip data explorer
7086
- [awair.runsascoded.com] ([GitHub][awair-gh] · [usage][awair-usage] · [diff][awair-diff]) — Awair air quality dashboard
@@ -88,7 +104,7 @@ function Dashboard() {
88104
[voro-gh]: https://github.com/runsascoded/ImageVoronoi
89105
[voro-usage]: https://github.com/search?q=repo%3Arunsascoded%2FImageVoronoi+use-kbd&type=code
90106

91-
### Comparison
107+
### Comparison <a id="comparison"></a>
92108

93109
Most web apps ship a static, read-only shortcuts list (at most). use-kbd provides a full keyboard UX layer:
94110

@@ -117,14 +133,14 @@ Most web apps ship a static, read-only shortcuts list (at most). use-kbd provide
117133

118134
GitHub's command palette (`⌘K`) is conceptually similar to use-kbd's omnibar, but disconnected from the shortcuts modal. Drive has a search bar (rare!), but it's filter-only and read-only. Gmail requires a Settings toggle before shortcuts work at all.
119135

120-
### Inspiration
136+
### Inspiration <a id="inspiration"></a>
121137

122138
- macOS and GDrive menu search
123139
- [Superhuman] omnibar
124140
- [Vimium] keyboard-driven browsing
125141
- Android searchable settings
126142

127-
## Core Concepts
143+
## Core Concepts <a id="concepts"></a>
128144

129145
### Actions
130146

@@ -396,7 +412,7 @@ Customize the footer with `footerContent`:
396412

397413
Pass `footerContent={null}` to hide the footer entirely.
398414

399-
## Components
415+
## Components <a id="components"></a>
400416

401417
### `<HotkeysProvider>`
402418

@@ -484,7 +500,7 @@ Floating action button (FAB) with expandable secondary actions. Opens the omniba
484500
/>
485501
```
486502

487-
## Styling
503+
## Styling <a id="styling"></a>
488504

489505
Import the default styles:
490506

@@ -508,7 +524,7 @@ Customize with CSS variables:
508524

509525
Dark mode is automatically applied via `[data-theme="dark"]` or `.dark` selectors.
510526

511-
## Mobile Support
527+
## Mobile Support <a id="mobile"></a>
512528

513529
While keyboard shortcuts are primarily a desktop feature, use-kbd provides solid mobile UX out of the box. **[Try the demos on your phone →][kbd.rbw.sh]**
514530

@@ -530,7 +546,7 @@ While keyboard shortcuts are primarily a desktop feature, use-kbd provides solid
530546

531547
For apps that want keyboard shortcuts on desktop but still need the omnibar/search on mobile, this covers the common case without extra configuration.
532548

533-
## Patterns
549+
## Patterns <a id="patterns"></a>
534550

535551
### ActionLink
536552

@@ -597,7 +613,7 @@ Usage:
597613

598614
Adapt for Next.js, TanStack Router, or other routers by swapping the router hooks.
599615

600-
## Low-Level Hooks
616+
## Low-Level Hooks <a id="hooks"></a>
601617

602618
For advanced use cases, the underlying hooks are also exported:
603619

@@ -710,7 +726,7 @@ Register three related actions as a compact triplet. See [Action Triplets](#acti
710726

711727
Wraps `useHotkeys` with localStorage persistence and conflict detection.
712728

713-
## Debugging
729+
## Debugging <a id="debugging"></a>
714730

715731
use-kbd uses the [`debug`] package for internal logging, controlled via `localStorage.debug`. Zero output by default—no config needed in downstream apps.
716732

@@ -741,6 +757,6 @@ localStorage.debug = 'use-kbd:hotkeys' // Only key handling
741757
[Superhuman]: https://superhuman.com
742758
[Vimium]: https://github.com/philc/vimium
743759

744-
## License
760+
## License <a id="license"></a>
745761

746762
MIT

0 commit comments

Comments
 (0)