NeoTerm UI

Command Palette

Terminal-styled command palette (Ctrl+K style) with search filtering.

Import

import { CommandPalette } from "neoterm-ui";

Usage

const [open, setOpen] = useState(false);

<CommandPalette
  open={open}
  onClose={() => setOpen(false)}
  placeholder="Type a command…"
  items={[
    { id: "1", label: "Go to Dashboard", shortcut: "⌘D", group: "Navigation", onSelect: () => {} },
    { id: "2", label: "Toggle Dark Mode", shortcut: "⌘T", group: "Settings", onSelect: () => {} },
    { id: "3", label: "Search Logs", group: "Tools", onSelect: () => {} },
  ]}
/>

Props

PropTypeDefaultDescription
openbooleanPalette visibility.
onClose() => voidClose callback.
itemsCommandItem[]Array of command items.
placeholderstringSearch input placeholder.

CommandItem

PropTypeDefaultDescription
idstringUnique identifier.
labelstringCommand label.
shortcutstringKeyboard shortcut hint.
iconReactNodeLeading icon.
groupstringGroup heading.
onSelect() => voidSelection handler.