Skip to main content
For an inline command palette that opens relative to a trigger button, embed Command inside a Radix UI Popover. Because cmdk already depends on Radix UI Dialog internally, adding the Popover primitive adds minimal bundle weight.

Installation

Basic example

Render Command directly inside Popover.Content. Do not use Command.Dialog here — that opens a full-screen modal, not a popover:
Do not nest Command.Dialog inside Popover.Content. Command.Dialog renders its own Radix Dialog portal and overlay, which conflicts with the Popover’s positioning and focus management. Use Command directly.

Controlled open state

Control the popover programmatically to open it via a keyboard shortcut or other trigger:
Call setOpen(false) inside onSelect handlers to close the popover after the user picks an item.

Styling the popover content

Target [cmdk-root] inside your popover content selector, or scope your styles to the Popover.Content wrapper: