A composable ⌘K command palette with fuzzy search, custom groups, built-in theme switcher, and animated content reveal.
Made by LéoInstallation
Usage
Custom trigger
Pass any element as trigger to replace the default search button entirely.
Keyboard shortcut
The dialog opens and closes with ⌘ K (macOS) / Ctrl K (Windows/Linux) by default. Use the shortcutKey prop to change the key portion.
API Reference
CommandMenu
groups?CommandMenuGroupDef[][]Array of CommandGroup definitions rendered inside the dialog.
showThemeGroup?booleantrueWhether to append the built-in Light / Dark / System theme group.
placeholder?string"Search…"Placeholder text inside the search input.
shortcutKey?string"k"Key paired with ⌘/Ctrl to toggle the dialog.
contentDelay?number150Milliseconds to wait after the dialog opens before revealing content.
trigger?ReactNode—Custom trigger element. Replaces the default search button when provided.
triggerProps?CommandMenuTriggerProps—Props forwarded to the default trigger button.
className?string—Extra className applied to the CommandDialog.
CommandMenuGroupDef
headingstring—Section heading displayed above the group.
itemsCommandMenuItemDef[]—Array of command items inside this group.
CommandMenuItemDef
labelstring—Display label for the command item.
icon?ComponentType<{ className?: string }>—Icon component rendered to the left of the label.
href?string—Route to navigate to via next/navigation on select.
action?() => void—Custom callback invoked on select. Takes precedence over href.
keywords?string[]—Extra words used for fuzzy matching.
CommandMenuTriggerProps
Extends native <button> props.
label?string"Search…"Text shown in the trigger button.
shortcut?string"K"Key letter shown in the keyboard shortcut badge.
showShortcut?booleantrueWhether to render the ⌘K badge.