Command Palette
A premium command palette with subtle color themes, framer-motion animations, and clean spacing.
ui Premium Plan
Availability
Included in Premium Plans
This flagship component is part of Future UI's monthly & yearly Premium plans and is not distributed via the free public CLI.
Import
import { CommandPalette } from "@/components/ui/command-palette"
Layout Variant
Color Theme
Shape
Spacing
Named Keys & Props
Pass these exact named keys as props on <CommandPalette />. Click any color pill to copy the prop.
colorDefault is "default"(Black & White)variantVisual style"default""compact""floating""glass""spotlight"shapeCorner shape"default""square""rounded""sharp"spacingInner spacing"default""2x""4x""6x""8x"Usage Example
A basic implementation example to get you started.
Example Implementation
import {
CommandPalette,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandItem,
CommandSeparator,
CommandShortcut
} from"@/components/ui/command-palette";
import { Calculator, Calendar, CreditCard, Settings, Smile, User } from"lucide-react";
import React from"react";
export default function Example() {
const [open, setOpen] = React.useState(false);
React.useEffect(() => {
const down = (e: KeyboardEvent) => {
if (e.key ==="k"&& (e.metaKey || e.ctrlKey)) {
e.preventDefault();
setOpen((open) => !open);
}
};
document.addEventListener("keydown", down);
return () => document.removeEventListener("keydown", down);
}, []);
return (
<CommandPalette open={open} onOpenChange={setOpen} variant="spotlight">
<CommandInput placeholder="Type a command or search..."/>
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem>
<Calendar className="mr-2 h-4 w-4"/>
<span>Calendar</span>
</CommandItem>
<CommandItem>
<Smile className="mr-2 h-4 w-4"/>
<span>Search Emoji</span>
</CommandItem>
<CommandItem>
<Calculator className="mr-2 h-4 w-4"/>
<span>Calculator</span>
</CommandItem>
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Settings">
<CommandItem>
<User className="mr-2 h-4 w-4"/>
<span>Profile</span>
<CommandShortcut>⌘P</CommandShortcut>
</CommandItem>
<CommandItem>
<CreditCard className="mr-2 h-4 w-4"/>
<span>Billing</span>
<CommandShortcut>⌘B</CommandShortcut>
</CommandItem>
<CommandItem>
<Settings className="mr-2 h-4 w-4"/>
<span>Settings</span>
<CommandShortcut>⌘S</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandPalette>
);
}Features
Key capabilities and highlights.
Key Capabilities
- ◆Compound architecture: CommandPalette, Input, List, Group, Item, Empty, Separator, and Shortcut.
- ◆Powered by cmdk for flawless, native-feeling keyboard interactions and fuzzy search.
- ◆Five premium visual variants: Default, Compact, Floating, Glass, and Spotlight.
- ◆10 subtle color themes that gently shift the border glow and accent without overwhelming the UI.
- ◆4 shape variants (rounded-2xl, square, rounded-3xl, rounded-lg) and 5 spacing levels.
- ◆Framer Motion spring enter/exit animations with fade-in list.
- ◆Out-of-the-box support for Cmd+K / Ctrl+K keyboard shortcuts.
- ◆Fully accessible with automatic focus trapping and ARIA roles.
Notes
Important implementation details to consider.
Implementation Details
- ◆Plan: Included in Future UI Monthly & Yearly Premium Plans.
- ◆Overview: Built on top of cmdk — the industry standard headless command menu library.
- ◆Props: variant (default/compact/floating/glass/spotlight), color (10 themes), shape, spacing.
- ◆Customize: Pass color, shape, and spacing to CommandPalette or standalone Command component.