terra vidhal

Command Palette

Navigation 11

About

A command palette with a trigger button, a global Cmd/Ctrl+K shortcut, grouped and searchable results, an animated active row, and full keyboard navigation with arrows, Home, End, Enter and Escape. Includes an empty state, focus trap and scroll lock.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Command Palette to your project and fits it to your theme.

Code

How Command Palette is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  Bell,
  Command,
  CreditCard,
  Home,
  LayoutGrid,
  Mail,
  Plus,
  Upload,
  Users,
} from "lucide-react";
import { CommandPalette, type CommandItem } from "@/components/ui/command-palette";

const ITEMS: CommandItem[] = [
  {
    id: "dashboard",
    label: "Open dashboard",
    description: "Jump back to the overview",
    group: "Navigation",
    icon: <Home />,
    shortcut: "G D",
    keywords: ["home", "overview", "stats"],
  },
  {
    id: "projects",
    label: "Go to projects",
    description: "Browse every active project",
    group: "Navigation",
    icon: <LayoutGrid />,
    shortcut: "G P",
    keywords: ["work", "board"],
  },
  {
    id: "team",
    label: "Team directory",
    description: "Find a teammate and their role",
    group: "Navigation",
    icon: <Users />,
    shortcut: "G T",
    keywords: ["people", "members"],
  },
  {
    id: "new-project",
    label: "New project",
    description: "Start from a blank board",
    group: "Create",
    icon: <Plus />,
    shortcut: "C P",
    keywords: ["add", "create"],
  },
  {
    id: "invite",
    label: "Invite a teammate",
    description: "Send an email invitation",
    group: "Create",
    icon: <Mail />,
    shortcut: "I T",
    keywords: ["member", "email"],
  },
  {
    id: "upload",
    label: "Upload an asset",
    description: "Add files to the shared library",
    group: "Create",
    icon: <Upload />,
    shortcut: "U A",
    keywords: ["file", "media", "image"],
  },
  {
    id: "notifications",
    label: "Notification settings",
    description: "Choose what reaches your inbox",
    group: "Workspace",
    icon: <Bell />,
    shortcut: "S N",
    keywords: ["alerts", "email", "preferences"],
  },
  {
    id: "billing",
    label: "Billing and plans",
    description: "Invoices, seats and payment method",
    group: "Workspace",
    icon: <CreditCard />,
    shortcut: "S B",
    keywords: ["invoice", "subscription", "payment"],
  },
  {
    id: "shortcuts",
    label: "Keyboard shortcuts",
    description: "See every command at a glance",
    group: "Workspace",
    icon: <Command />,
    shortcut: "?",
    keywords: ["keys", "help"],
  },
];

export default function CommandPaletteDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-background px-6 py-12">
      <CommandPalette items={ITEMS} defaultOpen footerNote={null} />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    169
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    442
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    33
  • Sidebar

    Sidebar

    444
  • Tabs

    Tabs

    38
  • Pagination

    Pagination

    121
  • Sidebar

    Sidebar

    367
  • Stacked Circular Footer

    Stacked Circular Footer

    470