oks-ui

Navigation

CommandPalette

The Cmd+K overlay: a search box over a fuzzy-filtered, grouped list of actions and destinations, with full keyboard navigation and a useCommandPalette hotkey hook.

Example

or press ⌘K / Ctrl+K

Props

isOpen

boolean

Default:

Whether the palette is shown.

onClose

() => void

Default:

Fired on Escape, outside click, and after a selection.

onSelect

(item) => void

Default:

Fired on activation, after the item's own onSelect.

filter

(items, query) => items

Default: built-in fuzzy

Replace the matcher; return the items to show, already ordered.

isLoading

boolean

Default: false

Spinner in the input; suppresses the empty message.

onQueryChange

(query) => void

Default:

Fired as the query changes.

closeOnEscape / closeOnOutsideClick / portal / container / zIndex / blur

Default:

Passed through to Backdrop.

hotkey

"mod+k" | string | false

Default: "mod+k"

Global open/toggle shortcut. mod = ⌘ on Apple platforms, Ctrl elsewhere. false binds nothing.

defaultOpen

boolean

Default: false

Initial open state.

onOpenChange

(open) => void

Default:

Fired when the open state changes.