artifactExperience & interface

Command Palette

A command palette is an on-demand searchable interface for finding and running commands or navigating to destinations, usually optimized for keyboard use.

Download Markdown (.md)

01What it means

A command palette combines a text input with a filtered list of available commands, resources, or destinations. It opens from a visible control or keyboard shortcut, ranks results from typed queries and context, and executes the selected item. It supplements rather than replaces a product’s understandable navigation and command structure.[1][2]

02Why it matters

For products with many commands, a palette gives experienced users a fast path without requiring memorized shortcuts or deep menu traversal. Its query logs can also reveal vocabulary mismatches, provided teams handle those logs with suitable privacy controls.

03When to use it

Use a command palette in command-rich products where users repeat tasks across many views and can benefit from keyboard efficiency. Avoid it as the only route to core functions, in simple products with few commands, or when search results cannot clearly distinguish actions from destinations.

04How it works

  1. Inventory eligible commands and destinations with stable names, synonyms, scope, and availability rules.
  2. Provide a discoverable opener and a documented shortcut that avoids platform conflicts.
  3. Filter and rank results as users type while showing command type, context, and shortcut where useful.
  4. Support predictable list navigation, execution, dismissal, empty results, and focus return.
  5. Measure successful execution and failed queries, then improve labels and ranking without hiding core navigation.

05A practical example

Example

An analytics workspace opens a palette with Command-K. Typing “export” lists Export current chart and Export dashboard with scope labels; choosing the chart command opens its format dialog, and Escape returns focus to the chart without changing the current page.

06Where it breaks

The pattern favors users who know roughly what to type, ranking errors can bury commands, and a large command registry requires governance. Global shortcuts may conflict with browsers, operating systems, assistive technology, or user customizations.

Common mistakes

  • Using the palette to compensate for incoherent navigation or labels.
  • Showing actions and destinations with identical presentation and ambiguous outcomes.
  • Providing no visible opener or shortcut documentation.
  • Collecting query text without considering sensitive information and retention.

07Sources

  1. User interfaceVisual Studio Code · Official documentationUser interface
  2. GitHub Command PaletteGitHub Docs · Official documentationGitHub Command Palette
View saved topics

Start typing to search titles, definitions, categories, and frameworks.