AgentCommandPalette
Searchable native command dialog with an action callback. Import from @agent-ui/react or a direct subpath. Tailwind CSS v4 theme tokens are required.
AgentCommandPalette ships with a full API table, a copyable example, and accessibility notes.
No command selected
Installation
Install the package once, then import AgentCommandPalette from its direct entry point or from the root.
pnpm add @agent-ui/reactimport { AgentCommandPalette } from "@agent-ui/react/blocks/command-palette";Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.
Usage
The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.
import { AgentCommandPalette } from "@agent-ui/react"; <AgentCommandPalette open={open} commands={commands} onOpenChange={setOpen} onSelect={run} />API reference
Every prop AgentCommandPalette accepts, its type, default, and behaviour.
| Name | Type | Default | Description |
|---|---|---|---|
| open | React prop | — | Configuration exposed through the component's public React props. |
| commands | React prop | — | Configuration exposed through the component's public React props. |
| onOpenChange | callback | — | Configuration exposed through the component's public React props. |
| onSelect | (command: AgentCommand) => void | — | Selected command callback. |
Accessibility
AgentCommandPalette composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.
3 lines · copy-ready