Skip to main content
The Raycast example is the most fully-featured of the four examples. It mirrors the look of the Raycast launcher on macOS: a fixed footer bar, a contextual sub-command popover triggered by ⌘K, animated gradient border effects in dark mode, and a shimmer loader line between the input and the list. Items carry a right-aligned meta label (“Application” or “Command”) and support keyword aliases for fuzzy matching.

Notable implementation details

Sub-command popover with a nested Command. Pressing ⌘K opens a Radix UI Popover containing its own self-contained Command root — list first, input at the bottom — contextual to the currently highlighted item. The SubCommand component listens for the keyboard shortcut via document.addEventListener and uses a useEffect to lock the parent list’s scroll (overflow: hidden) while the popover is open, preventing accidental scrolling behind it.
Animated gradient border in dark mode. In dark mode the root element uses two stacked pseudo-elements (::before and ::after) sitting at z-index: -1. The ::after pseudo-element holds a moving linear-gradient that animates via background-position (@keyframes shine), while ::before fades in a solid box-shadow border (@keyframes border). Together they produce the glowing border reveal seen when the palette first opens.
Keyword aliases for fuzzy matching. Each Command.Item passes a keywords prop — an array of additional strings like ['issue', 'sprint'] for the Linear item. cmdk scores these alongside the item’s visible value, so typing “sprint” still surfaces “Linear” even though that word does not appear in the label.
The SubCommand component is self-contained and reusable. You can drop it into any cmdk-based menu by passing it the parent inputRef (so focus returns to the input on close), a listRef (for scroll locking), and the currently selected item value to use as the popover heading.