Presentational “Press X to see Y” chip for keyboard shortcut affordances.

Location: src/components/ui/KeyboardHint.tsx

Usage

Pair with a key listener (see ShortcutDemo) or any onActivate handler.

import KeyboardHint from "@/components/ui/KeyboardHint";

<KeyboardHint
  keyLabel="s"
  actionLabel="Security stack"
  onActivate={() => setOpen(true)}
/>

Props

PropTypeDescription
keyLabelstringKey shown in the <kbd>
actionLabelstringShort label after “to see the …”
onActivate() => voidOptional click handler
classNamestringExtra classes

Related