Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Hotkeys API Reference
App Hotkeys API Reference
Key hold & held keys API Reference
Hotkey Recorder API Reference
Normalization & format API Reference
Hotkeys API Reference

useHotkeyRegistrations

ts
function useHotkeyRegistrations(): HotkeyRegistrationView[];
function useHotkeyRegistrations(): HotkeyRegistrationView[];

Defined in: useHotkeyRegistrations.ts:31

React hook that reactively reads every hotkey registration, chords and sequences, from the singleton HotkeyManager. Narrow each view with kind.

This hook does NOT require the HotkeysProvider. It re-renders when registrations change, including trigger counts and sequence progress.

Returns

HotkeyRegistrationView[]

All registrations, without callbacks

Example

tsx
function ShortcutPalette() {
  const registrations = useHotkeyRegistrations()

  return (
    <ul>
      {registrations.map((reg) => (
        <li key={reg.id}>
          {reg.options.meta?.name}: {formatForDisplay(reg.hotkey)}
        </li>
      ))}
    </ul>
  )
}
function ShortcutPalette() {
  const registrations = useHotkeyRegistrations()

  return (
    <ul>
      {registrations.map((reg) => (
        <li key={reg.id}>
          {reg.options.meta?.name}: {formatForDisplay(reg.hotkey)}
        </li>
      ))}
    </ul>
  )
}