niceui

Command Palette

A ⌘K search palette with live filtering, arrow-key navigation and an Enter action per item.

ReactTailwind CSSTypeScriptNavigationMIT · Free
⌘K
  • Hero — HorizonBlock
  • Pricing — MinimalBlock
  • Command PaletteComponent
  • Stat CardComponent

Installation

01

Install with the shadcn CLI.

$ npx shadcn@latest add https://niceui.dev/r/command-palette.json
02

Or copy the source manually into components/ui/command-palette.tsx. No extra dependencies.

Usage

import { CommandPalette } from "@/components/ui/command-palette";

export default function Example() {
  return (
    <CommandPalette
      placeholder="Search components…"
      items={[
        { label: "Hero — Horizon", hint: "Block" },
        { label: "Pricing — Minimal", hint: "Block" },
        { label: "Command Palette", hint: "Component" },
      ]}
    />
  );
}

For AI assistants

This page is also available as Markdown and as a shadcn registry item. Use Copy prompt to hand the full source to Claude, Cursor or v0.