Skip to contentKino
Skip to Content

Command

A command menu. Type to find a command, use the arrows to move, and press Enter to run it, on a page or in a dialog from ⌘K.

npx shadcn add https://kinoui.com/r/command.json
Share on

Examples

Kino

In a dialog

Press the search button to open the menu over the page, run a command, and see the issue change. In your app, useShortcut opens it from ⌘K.

Assign to…A
Change status…S
Set priority…P
Move to project…ShiftM
Copy issue IDCtrlPeriod
Copy link to issueCtrlShiftComma
Archive issue
New issueC
New project
InboxGI
My issuesGM
ProjectsGP
Workspace settingsGS
Change theme…
Keyboard shortcutsQuestion mark
Log out
Up arrowDown arrowNavigateEnterRun

On a page

Without its dialog, the menu sits on the page as a box, and moves to the height of what matches as you type.

Urgent0
HighCurrent1
Medium2
Low3
No priority4
Up arrowDown arrowNavigateEscBackEnterRun

Pages

A command that needs a choice opens a page: give pages the names of the open pages and items the current page’s rows. The new page pushes the last one out, and Escape, Backspace or the page’s name goes back.

No commands match “refund”
Up arrowDown arrowNavigateEscClearEnterRun

Nothing matches

CommandEmpty takes the rows’ place and says what was looked for. Delete a letter to bring the commands back.

Installation

npx shadcn@latest add https://kinoui.com/r/command.json
Files
lib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/input.tsxcomponents/kino/separator.tsxlib/run-progress.tslib/highlight.tslib/menu.tsxcomponents/kino/select.tsxlib/filter-list.tsxlib/flow.tslib/panel.tsxcomponents/kino/dialog.tsxcomponents/kino/command.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Command

PropTypeDefaultDescription
itemsItem[]{ value, items }[]NoneThe current page’s commands, or groups of them.
pagesstring[][]The names of the pages opened from the first one. Each new page starts with an empty search and its first row highlighted.
onBack() => voidNoneCalled to go back a page: Escape or Backspace on an empty search, or the page’s name.
labelstring'Commands'The first page’s name, read out when the person goes back to it.
defaultValuestring''The search at first.
valuestringNoneThe search, when you hold it. Empty it when pages changes.
onValueChange(search) => voidNoneCalled as the search changes.
filterfunctionnullNoneHow a command matches the search. null shows items as they are, for results from a server.

CommandDialog

PropTypeDefaultDescription
titlestring'Command menu'Names the dialog for screen readers.
contentPropsDialogContent propsNoneProps for the dialog's popup, such as the container it renders in, <body> by default.

CSS variables

VariableSet it onDefaultDescription
--command-slideCommand, or anything above it100%How far a page slides as the next one pushes it out.

Accessibility

  • The search is a combobox and the rows a listbox: focus stays in the search, the arrows move the highlight, and Enter runs the highlighted command.
  • Escape clears the search first, then goes back a page, and only then closes the dialog. Backspace on an empty search goes back too.
  • Opening or leaving a page is read out, since the search’s new name alone isn’t.
  • The dialog moves focus to the search when it opens and back to what opened it when it closes. Name it with title.
  • When the system asks for less motion, pages fade in place of sliding and the box changes height at once.