Skip to content
kerfjsGitHub

ShortcutsOverlay

Lists the shortcuts in use now, grouped and searchable. Press ? to open it.

SourcePackage @kerf-js/veneer

Preview

tsx
import { state } from '@kerf-js/core'import { Button, ShortcutsOverlay } from '@kerf-js/veneer'import { createShortcuts } from '@kerf-js/veneer-core'export function App() {  const open = state(false)  return (    <>      <Button        emphasis="outline"        tone="neutral"        onClick={() => (open.value = true)}      >        Keyboard shortcuts      </Button>      <ShortcutsOverlay        open={open}        shortcuts={KEYS}      />    </>  )}const KEYS = createShortcuts()

Installation

npm install @kerf-js/veneer

Usage

tsx
import { ShortcutsOverlay } from '@kerf-js/veneer'

Accessibility

?
Opens it
Esc
Closes it

API Reference

PropTypeDefaultDescription
openState<boolean>—Whether it shows, if you want to own it.
shortcuts{ register(s: Shortcut): () => void; list: () => Shortcut[]; subscribe(f…registryThe list to read. Default: the shared one.

Parts

Every element carries a stable name, so you can style it from your own CSS: [data-scope="shortcuts"] [data-part="groups"]

groupsempty

RelatedKbdCommand palette