Skip to content
Bitsy UI 0.x
Theme
Menu: Command Palette
  1. Docs
  2. Bits

Command Palette

Command Palette lets people search and run actions or jump to pages from the keyboard, in a modal search box. Author the commands; a small init() module filters and runs them.

Public web API

A native <dialog> holding a combobox input and a listbox of commands. Focus stays in the input; aria-activedescendant points at the active command.

  • Open it with a button: commandfor and command="show-modal". Escape and focus return are native.
  • A link command is an <a href role="option">; any other command fires a command event with detail.value.
  • Add data-bitsy-command-palette-shortcut="k" to bind Cmd or Ctrl plus K. Nothing is bound without it.

Variants and states

Open one, type "create" or "zzz", and use the arrow keys.

With footer
Actions
New project N
Invite teammate
↑↓ to moveEnter to runEsc to close
Global shortcut (Ctrl or Cmd K)
Actions
New project N
Invite teammate

Bit boundary

  • It is a shortcut, never the only way to reach a page or action. Use Combobox to pick a form value.
  • Nested pages, recent commands, and async results are out of scope.

Bitsy UI is MIT licensed. Source on GitHub.