Skip to content
All terms
Components/lexicon/command-palette

What is a Command Palette?

also known as⌘K menu · cmd-k · spotlight · quick switcher · action menu

A command palette is a keyboard-first overlay, usually opened with Cmd+K or Ctrl+K, that lets you search and run any action or page from one input.

Made ofA modal dialog holding a search input and a filtered list of actions you can move through with the arrow keys.

Key CSSposition: fixedtop: 20vh; left: 50%transform: translateX(-50%)width: min(640px, 92vw)
Search commands…
⌘K
New document
⌘N
Open file
⌘O
Search project
⌘P
01 · Definition

Ask a heavy user of a modern work tool how they get around and many will not mention the menus at all. They hit a shortcut, type three letters, press Enter, and they are somewhere else. That small box is the command palette. It is a centred overlay with a single text field and a list of results below it, summoned by a global shortcut so you never have to hunt through navigation.

The usual trigger is Cmd+K on a Mac and Ctrl+K on Windows and Linux. Many products settled on that combination, so users already expect it. Inside, the field does fuzzy matching across pages, settings, recent items and contextual actions. A result row typically shows an icon, a label and, on the right, its own keyboard shortcut. You move with the arrow keys, confirm with Enter and close with Escape. The first time it works for someone, it feels like a superpower.

The idea grew out of code editors. Programs like Sublime Text and Visual Studio Code offered a searchable list of commands so developers could use features without memorising every menu location or key binding. Productivity and design tools then adopted the same idea, and over time it spread to mainstream products. Today it is the standard power-user navigation pattern for apps with a lot of destinations and actions, roughly thirty or more.

The craft details decide whether it feels good. Focus the input the moment the palette opens. Centre the dialog on the screen instead of pinning it high, which feels more deliberate and leaves space for results. Dim or blur the page behind it so attention narrows. Group results with clear labels, such as Pages, Actions, Recent and Help, and highlight the active row with a gentle tint rather than a loud full-width fill. Make search fast by matching against a static in-memory index, not by waiting on a server for every keystroke. Show the shortcut hint somewhere visible, because a feature nobody knows about is a feature nobody uses.

Do not make it the only way in. A palette is an accelerator for people who know the app, not a replacement for visible navigation. New users need to see where things live, and mobile users have no global keyboard at all. Treat every action in the palette as a second route to something that also exists in the interface.

Accessibility needs real attention. The palette should be built on a proper dialog with focus trapped inside, a labelled input, the combobox and listbox pattern for the results, and announcements for the number of matches. Libraries such as cmdk for React give you an unstyled, accessible base with fuzzy search, which you can theme to match your design system. Escape must always close it and return focus to wherever the user was.

It works best in developer tools, design tools, dashboards, CMS products and anything people use many times a day. It is overkill for a marketing site with six pages.

When you prompt an AI for one, include the trigger, the groups, the keyboard behaviour and the library: a centred 560px cmdk dialog opened by Cmd+K, grouped results, arrow-key navigation, Enter to run, Escape to close.

Use when
  • Power-user products (developer tools, design tools, CMS, dashboards)
  • Any app with 30+ distinct navigation destinations or actions
  • Apps where users repeat the same flow many times per day
Avoid when
  • Consumer apps where users won't discover the shortcut
  • Mobile-first products (no global keyboard)
  • Simple marketing sites with 5–7 pages
02 · Do
  • +Bind to `⌘K` (Mac) and `Ctrl+K` (Win/Linux), don't invent a new shortcut
  • +Show the shortcut hint (`⌘K`) in a visible spot in the UI
  • +Group results: Pages, Actions, Recent, Help
  • +Make the input autofocus on open and `Esc` close
03 · Don't
  • −Don't make the palette the only way to access important features
  • −Don't put it modal at the top of the screen, center it
  • −Don't load all actions synchronously, fuzzy-search a static index
06 · Common questions

Command Palette: your questions, answered

What is a command palette?

It is a keyboard-first overlay, normally opened with Cmd+K or Ctrl+K, with a single search field. It lets users jump to pages, find items and run actions without using menus, so frequent tasks become a few keystrokes long.

What library should I use to build a command palette?

For React, cmdk is a popular choice: it is unstyled, accessible and includes fuzzy search, so you add your own visual layer. Other frameworks have equivalents, and you can also build one on the native dialog element.

Should a command palette replace the main navigation?

No. It speeds things up for power users but should never be the only route to a feature. New users and mobile users need visible navigation, so treat the palette as an extra, faster path.

When does an app need a command palette?

Usually when it has thirty or more destinations or actions and people use it often, such as developer tools, design tools and dashboards. A simple site with a handful of pages does not need one.

How do I help people discover the shortcut?

Show a Cmd+K hint in a visible place, such as the search box in the header, and list the shortcut in tooltips and menus. Hidden features go unused, so repeat the hint where people already look.

People also ask

More quick answers

Command palette vs search bar: what's the difference?

A search bar finds content. A command palette finds content and also runs actions, such as creating an item or switching a setting, all from the keyboard.

Is Cmd+K the right shortcut?

It is the closest thing to a standard, so users expect it. Avoid inventing a different key unless Cmd+K is already taken by something essential in your app.

Can I use glass styling on a command palette?

Yes, a blurred translucent panel over a dimmed page is a popular look, though the text needs enough contrast over any backdrop.

How is it different from a modal dialog?

Both are overlays, but a modal interrupts to confirm or collect input, while a palette is a summoned tool you open on purpose and dismiss instantly.

07 · Related terms
Free and open source

Found this useful? A GitHub star helps other designers find it.

Star on GitHub