Y2K UI

Command

A command palette and search component powered by cmdk.

command-demo.app

Installation

terminal.sh
npx y2kui@latest add command

Usage

import {
  Command,
  CommandInput,
  CommandList,
  CommandEmpty,
  CommandGroup,
  CommandItem,
  CommandShortcut,
} from "@/components/ui/command"

<Command className="w-72">
  <CommandInput placeholder="Type a command..." />
  <CommandList>
    <CommandEmpty>No results.</CommandEmpty>
    <CommandGroup heading="Actions">
      <CommandItem>New File <CommandShortcut>⌘N</CommandShortcut></CommandItem>
    </CommandGroup>
  </CommandList>
</Command>

Props

PropTypeDefaultDescription
CommandInputsee cmdkFilterable search input.
CommandEmptyReactNodeShown when no results match.
CommandGroup{ heading?: string }Groups items under a label.
CommandItemsee cmdkSelectable command item.
CommandShortcutReactNodeKeyboard hint label.

On this page