Command palette

Cmd+K search dialog for tools, actions, and keyboard shortcuts. Built on cmdk and Radix Dialog.

Install

npx shadcn@latest add https://substrate.georgedrury.co.uk/r/command-palette

Examples

Default

"use client"

import { useState } from "react"

Interaction

  • ⌘K / Ctrl+K opens and closes the palette.
  • Type to fuzzy-search across all items.
  • Arrow keys to navigate, Enter to select.
  • Escape to dismiss.

Components

ComponentDescription
CommandPaletteDialog wrapper with ⌘K listener
CommandInputSearch input with magnifying glass icon
CommandListScrollable results container
CommandEmptyShown when no results match
CommandGroupLabelled group of items
CommandItemSelectable result row
CommandShortcutRight-aligned keyboard shortcut hint
CommandSeparatorHorizontal divider between groups