Components
Components
CommandPalette
Modal ⌘K command finder with grouped actions, shortcuts, and async loading.
newfree
Install
@hewnui/ui · hewnui
CommandPalette pairs a dialog trigger with React Aria Autocomplete and Menu. Filter grouped commands, show shortcut hints, and wire an optional global hotkey.
Press Ctrl+K anywhere on this page — the hook skips composing IME events and picks ⌘ vs Ctrl by platform.
Usage
States
- Loading —
CommandPaletteList isLoadingshows a polite status with spinner - Empty — filtered Menu
renderEmptyStateviaemptyLabel - Disabled —
CommandPaletteItem isDisabled
Accessibility
- Dialog role with an accessible name; focus moves into the search field on open
- Escape and outside click dismiss; focus returns to the trigger
- Arrow keys move between commands; Enter activates; typeahead filtering via Autocomplete
- Shortcut hints use the
Keyboardelement; icons are presentational - Reduced motion: enter/exit transitions fall back with
motion-reduce
Docs search note
The docs site still uses Fumadocs search. CommandPalette could wrap that surface later (same trigger + Autocomplete pattern) without changing this component’s API — not refactored in this release.
API reference
Props for CommandPalette from @hewnui/ui/command-palette. Generated from component types — not hand-written.
Prop
Type