Skip to main content
The Linear example replicates the compact, keyboard-driven command palette used in the Linear issue tracker. Items are rendered from a static data array, each carrying an icon, a label, and one or more shortcut keys displayed at the right edge. The palette is scoped to a single issue — a small badge above the input shows the issue ID — making it feel like a contextual action menu rather than a global launcher.

Notable implementation details

Data-driven item list. All items are defined in a single items array outside the component, each entry holding an icon, a label, and a shortcut array. The JSX simply maps over this array to produce Command.Item elements. This approach makes it trivial to add, remove, or reorder actions without touching the component tree.
Left-border selection indicator. The selected state is styled with a CSS ::after pseudo-element — a 3 px wide, full-height bar in Linear’s signature purple (#5f6ad2) — pinned to the left edge of the item using position: absolute; left: 0. This is a purely CSS technique that requires no extra DOM nodes.
Branded caret color. The input uses caret-color: #6e5ed2 to tint the text cursor in Linear’s purple. This small detail ties the palette to the host app’s brand with a single CSS property and no JavaScript.
The shortcut display is intentionally minimal — plain <kbd> text with no background chip. If you want Vercel-style pill-shaped keys instead, add a background and border-radius to the kbd rule inside [cmdk-linear-shortcuts].