ui-kit0.0

Overlays

Command palette

Search and run anything with ⌘K.

Usage

A searchable list of pages and actions. CommandDialog puts the palette in a modal at the top of the screen; with hotkey it toggles on ⌘K / Ctrl + K from anywhere on the page.

Nothing run yet

Inline

Command on its own is the same palette in the page flow, for a search page or a settings finder. Type to filter: results are ranked by prefix, then word start, then substring, and keywords find an item by other names (try "dark mode").

Dashboard
Billing
Team
New project⌘N
Download invoices
Invite teammate
Switch to dark theme
Notification settings
Security keys (soon)

Nothing run yet

When to use

  • Apps with many destinations and actions, where power users want to jump by typing.
  • As an addition to navigation, never the only way to reach something.

Not for: a short choice from a fixed list (use a select), or free-text search results with their own page.

API

Command

PropTypeDefaultDescription
searchstring—Controlled search text; also defaultSearch and onSearchChange.
shouldFilterbooleantrueFilter and rank items. Set false to filter yourself, e.g. async results.
filter(value, search, keywords) => number—Custom scorer: 0 hides an item, higher ranks it first.
labelstring—Accessible name of the palette.
onItemSelect(value: string) => void—Called after any item runs.

CommandItem

PropTypeDefaultDescription
valuestring—What the search matches. Defaults to the item text.
keywordsstring[]—Extra words that find the item.
iconReactNode—Leading 16px icon.
shortcutReactNode—A string such as "⌘N" becomes key caps; or pass your own node.
disabledboolean—Skipped by the arrows, cannot run.
onSelect(value: string) => void—Runs on click or Enter.

CommandDialog

PropTypeDefaultDescription
open / defaultOpen / onOpenChangeboolean—Controlled or uncontrolled open state.
hotkeybooleanfalseToggle with ⌘K / Ctrl + K.
closeOnSelectbooleantrueClose after an item runs.
titlestring'Command palette'Visually hidden dialog title.

Also: CommandInput, CommandList, CommandGroup (heading), CommandEmpty, CommandSeparator and CommandFooter. Groups hide when a search leaves them empty; separators hide while searching. Better matches float to the top of their group.

Keyboard

KeyAction
⌘K / Ctrl + KOpens or closes the dialog (when hotkey is on).
↓ / ↑Next / previous item (wraps around). Focus stays in the search field.
Home / EndFirst / last item.
EnterRuns the highlighted item.
EscCloses the dialog.

Accessibility

  • The search field is a combobox with aria-controls on the listbox and aria-activedescendant on the highlighted option, so focus never leaves the field.
  • Items are role="option" with aria-selected; groups are labelled by their heading.
  • The dialog is a modal with a hidden title; the field is focused on open and the search resets on close.
  • Pointer hover moves the highlight; touch taps run the item.

Motion

  • The dialog uses the standard soft rise: overlay fade, panel rise 8px with scale .96 and un-blur.
  • The highlight changes instantly (100ms tint) so fast typing never feels laggy.
  • Reduced motion: it appears and disappears without movement.