Hotkey: Shortcut listener
matchesHotkey checks a keydown event against a hotkey. Modifiers must match exactly, so mod+b doesn't fire for mod+shift+b.
- BoldCommand B
- ItalicCommand I
- StrikethroughShift Command X
Press a shortcut
This adds the example as components/examples/hotkey/listener.tsx, together with the Hotkey component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/hotkey-listener.jsonTo add only the component, follow the Hotkey installation.
- CommandA searchable list of actions, inline or as a ⌘K palette, with pages, shortcuts and highlighted matches.
- KbdKey caps for shortcuts that show the right symbols on every platform, read them out properly and press down with the real keys.
- SidebarAn app sidebar that collapses to icons or off canvas, stays pinned under your header, and becomes a swipeable sheet on phones.