Avara UI

Command Palette

A fast, keyboard-first Command Palette with a search box trigger, instant filtering, hotkey badges, grouped sections, and a modal overlay.

Starts as a compact search bar (Search anything... [Ctrl] [K]) in your header that opens a centered modal over a dimmed overlay, or renders always-open inline on the page. Choose a look via the variant prop ("linear", "nested", "inline", or "ai").

Linear

Click the search box in the top right (or press Ctrl+K) to open the command palette modal over the dimmed overlay.

Passvariant"linear"
selects the Linear-inspired command palette variant.
triggerPlaceholder"Search anything..."
sets the placeholder label inside the initial search bar trigger.

Installation

New project? Follow the installation guide to set up Tailwind CSS, shadcn, the cn helper and lucide-react, register the @avara-ui registry once, then copy your styles from the Themes page.

Install Command Palette

npx shadcn@latest add https://avaraui.com/r/command-palette.json

components/custom/blocks/CommandPaletteBlock.tsx is written into your project. Copy any snippet from a Usage tab above and it runs.

Install dependencies

Nothing beyond the shared setup — Command Palette needs only the cn helper and lucide-react, which the installation guide already put in place.

Variants

Nested

Contextual issue actions with drill-down sub-menus for Status, Assignee, Priority, and Project. Press Backspace or click ← to return.

Passvariant"nested"
enables contextual badge pills and multi-level sub-menus with live selection checkmarks.
contextId"AVA-214"
displays the active record identifier pill beside the search input.

Inline

Always-open embedded command palette without a trigger bar or modal overlay — type immediately to filter items.

Passvariant"inline"
renders the palette permanently open directly in your layout with no backdrop modal.

Ask AI

Search or ask any question — displays a skeleton loader, streams the answer character by character with citations, and lists matching help center sources (or a support fallback).

Passvariant"ai"
enables suggested questions, skeleton loading state, streamed AI answers with citations, and follow-up queries.

Props Reference

PropTypeDefaultDescription
variant"linear" | "nested" | "inline" | "ai""linear"Selects the command palette variant. linear renders the trigger + grouped modal; nested enables contextual issue actions with drill-down sub-menus; inline renders the palette always open directly on the page without a modal; ai adds suggested questions and streamed AI answers with sources.
openbooleanundefinedControls the visibility of the command palette modal (controlled mode).
defaultOpenbooleanfalseSets the initial open state when using the component in uncontrolled mode.
onOpenChange(open: boolean) => voidundefinedCallback fired whenever the modal opens or closes via trigger click, backdrop click, Escape key, or Ctrl+K / ⌘K.
triggerPlaceholderstring"Search anything..."Placeholder label displayed inside the initial search bar trigger button.
placeholderstring"Search pages, projects and actions"Search input placeholder inside the open modal dialog (defaults to "Type a command or search" in the nested variant).
groupsCommandPaletteGroupType[]DEFAULT_COMMAND_PALETTE_GROUPSGrouped sections and items (with icons, tags, shortcut keycaps, and keywords) displayed in the linear variant.
onSelect(item: CommandPaletteItemType) => voidundefinedCallback fired when an item is clicked or activated with the Enter key.
shortcutsstring[]["Ctrl", "K"]Shortcut keycap badges rendered on the right of the trigger bar. Automatically displays ⌘ on macOS.
contextIdstring"AVA-214"Record/issue identifier badge rendered beside the search input in the nested variant.
contextTitlestring"Rewrite the welcome email"Primary section heading shown in the root view of the nested variant.
nestedStateNestedPaletteStateDEFAULT_NESTED_PALETTE_STATECurrent values for status, assignee, priority, and project in the nested variant.
onNestedStateChange(next: NestedPaletteState) => voidundefinedCallback fired whenever a user selects an option inside a nested sub-menu.
colorstringundefinedOptional custom accent color override (hex or CSS custom property).
triggerClassNamestringundefinedAdditional Tailwind CSS classes applied directly to the trigger search bar button.
classNamestringundefinedStandard Tailwind CSS overrides applied to the outer container.