terra vidhal

Command Palette

Navigation 6

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
  • Gravity Stars Background

    Gravity Stars Background

    13
  • Booking Calendar

    Booking Calendar

    10
  • Topographic Lines

    Topographic Lines

    8
  • Spotlight Card

    Spotlight Card

    8
  • Audio Waveform

    Audio Waveform

    7
  • Kpi Counter

    Kpi Counter

    6
  • Notification Center

    Notification Center

    5
  • Marquee

    Marquee

    4

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    120
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    338
  • Sidebar

    Sidebar

    428
  • Astryx Clickable Card

    Astryx Clickable Card

    1
  • Tabs

    Tabs

    37
  • Astryx Breadcrumb Item

    Astryx Breadcrumb Item

    1
  • Navbar

    Navbar

    80
  • Pagination with Ellipsis

    Pagination with Ellipsis

    30