useHotkeys — Search and Help Shortcuts
- from @astryx
- by Astryx
Page shortcuts registered with useHotkeys: "/" focuses the search field and "?" opens the shortcut help, while typing either character in the field just types it. A switch turns the single-key shortcuts off through isDisabled.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @astryx/example-use-hotkeys-search-and-help-shortcutsRegistry dependencies0
The CLI adds no other registry items with this one.
