Kanzo UI
Actions

Command

A filterable command palette, inline or in a dialog.

Ark UI

A palette runs commands, so why is it a combobox? Because the role follows the interaction, not the payload: type to filter, arrow to highlight, enter to run — and a menu cannot filter at all. See the rule.

Post a contract⌘N
Claim a contract
Show overdue contracts
Find a member⌘K
Who is ready today
Open the bestiary
Edit the party rules
Change the hall's colours

Usage

import {
  Command,
  CommandContent,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
  CommandShortcut,
  useFilter,
  useListCollection,
} from "@kanzo-tech/ui";

Command is a Combobox that is permanently open, never closes on select, and clears its selection after each pick — the behaviours a palette needs and a combobox does not. You drive it with a list collection and filter its items on every keystroke:

const { contains } = useFilter({ sensitivity: "base" });
const { collection, filter } = useListCollection({
  initialItems: COMMANDS,
  filter: contains,
  groupBy: (item) => item.group,
});

Filtering happens in your collection, not inside the component, so the same palette can be fed by a local array or a server search without changing its markup.

Anatomy

<Command collection>
  <CommandInput />
  <CommandContent>
    <CommandEmpty />
    <CommandList>
      <CommandGroup heading>
        <CommandItem item>
          <CommandShortcut />
      <CommandSeparator />
  <CommandFooter />

The root is flex-1 with min-h-0, so it needs a parent that gives it a height — a flex column of fixed height inline, or CommandDialogContent.

In a dialog

CommandDialog is the Dialog root re-exported, and CommandDialogContent supplies the sizing plus a screen-reader-only title and description, so the palette is announced properly without visible chrome. Because the root is Dialog's, so is the trigger: use DialogTrigger for an uncontrolled palette, or drive open yourself when a ⌘K handler shares the state, as below.

Keyboard

KeyDoes
/ Moves the highlight to the next / previous command, stopping at the ends rather than wrapping.
Home / EndHighlights the first / last command — the list owns them outright, because the palette is never closed.
EnterRuns the highlighted command; the list stays open and the query clears.
EscCloses CommandDialog; an inline palette has nothing to close.

Command sets inputBehavior="autohighlight", so the top match is already highlighted after every keystroke and Enter runs it without a single ; no global shortcut is bound for you — +K is yours to wire.

API Reference

CommandDialogContent

PropTypeDefault
titlestring"Command Palette"
descriptionstring"Search for a command to run..."
sizeDialogContentProps["size"]"lg"

CommandInput

PropTypeDefault
sizeInputProps["size"]"md"

CommandGroup

PropTypeDefault
headingstring | ReactNode

collection, onInputValueChange, onValueChange and the rest are Ark's Combobox.Root; CommandItem takes Ark's item.

On this page