Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Command

Searchable command palette and combobox surface with groups, items, and shortcuts.

Suggestions
Button ⌘B
Dialog ⌘D
Theming ⌘T

Usage

import {
  Command,
  CommandInput,
  CommandItem,
  CommandList,
} from "@ilha/ui-sdk/command";
import {
  command,
  commandInput,
  commandInputWrapper,
  commandItem,
  commandList,
} from "coatx/command";

export const Palette = () => (
  <Command {...command()}>
    <div {...commandInputWrapper()}>
      <CommandInput
        aria-label="Search"
        placeholder="Run a command..."
        {...commandInput()}
      />
    </div>
    <CommandList {...commandList()}>
      <CommandItem
        value="theme"
        class={(s) => commandItem({ highlighted: s.highlighted }).class}
      >
        Toggle theme
      </CommandItem>
    </CommandList>
  </Command>
);

Exports (coatx/command)

Export Description
command(options?) Command surface container
commandInputWrapper(options?) Top search bar with bottom border
commandInput(options?) Borderless search input
commandList(options?) Scrollable results list
commandEmpty(options?) Empty state copy
commandGroup(options?) Grouped commands wrapper
commandGroupHeading(options?) Group label
commandItem(options?) Command option row
commandSeparator(options?) Group divider
commandShortcut(options?) Right-aligned shortcut hint
commandStyles Compiled StyleX style map

Was this page helpful?