A command palette as one web component
<ninja-keys> gives any page a keyboard
palette: nested menus, per-action hotkeys, a search you can replace, and a field
query language. It works with any framework, or none.
This site’s search is the palette
Press Ctrl K anywhere. It is ninja-keys with the catsearch searcher over every page, heading and API symbol, so it takes queries as well as words:
- every event the element fires
- the colour properties
- hotkeys, in the guide only
- the element’s methods
What this fork adds
This is a maintained fork of ssleptsov/ninja-keys, moved to Lit 3, with these additions:
- A pluggable search The searcher property replaces how the palette matches, and can add a notice and completions under the input.
- Field queries @appulsauce/ninja-keys/catsearch: section:git, under.title:settings, -is:draft, with completions as you type.
- Driving it from the page open({search}) with text already typed, submit() to run the first match, open and close events.
- Types for everything Typed events with no casts, nested children that type-check, and every property documented.
- Hotkey fixes Keys rebind when changed, are released when data changes or the element leaves, and never pile up.
Start here
- Installation from npm, a CDN, or a build of main
- Examples from a basic palette to field queries, each running on its page
- API reference generated from the source