Skip to content
ghostui

Preview

Use the tabs to compare the temporary Basic palette, inset Layer dialog, and inline Preview layout.

Meeting recap
Weekly update
Rewrite clearly
Use prompt

Meeting recap

Reusable prompt

Turn these meeting notes into a short recap. Start with the decision. Then list action items with an owner and due date. Keep unresolved questions separate. Do not invent details.

Design guidance

Use Command to find one action or saved prompt in a known set. Keep search text separate from the highlighted row. Arrow keys and pointer movement update the highlighted record; they do not run the action. Give each item an onClick callback that acts on that exact record. Base UI calls the same item callback for Enter.

The caller owns records, filtering, action results, and any dialog state. Insert exact prompt text into the current draft. Use an inline picker when search belongs to the current task. Use a dialog for temporary search. Keep disabled actions visible only when their context matters; disabled rows cannot be highlighted or activated.

Command.Shortcut displays a hint. It does not install a keyboard handler. Add a scoped handler when the caller wants a key to run an action.

Installation

Install

The examples also compose Button, Kbd, Tabs, and Textarea. Add those components when copying their examples.

Basic usage

Command.Input composes Autocomplete behavior with the canonical InputGroup control. The item callback receives the record directly, so two records can have the same title. For caller filtering, pass the filtered records as items with filter={null}, or provide filteredItems while preserving the original flat or grouped shape.

Structures

For a plain palette, omit Layout, Panel, and Preview. Use Group and GroupLabel only when the list needs categories. Dialog adds its focus lifecycle around the same search/list composition.

Examples

Basic dialog

Use Basic for a short list of prompts. The dialog has a hidden title, returns focus to its trigger, and inserts the chosen prompt into an editable draft.

Layer dialog

Use Layer when the palette needs an inset surface. The example opens both the 600px single-column list and the 880px split view with a 320px list panel.

Preview detail

Use Preview when the highlighted prompt needs a readable detail pane. Highlighting changes the preview. The explicit Use prompt button inserts that record into the editable draft.

Meeting recap
Weekly update
Rewrite clearly
Use prompt

Meeting recap

Reusable prompt

Turn these meeting notes into a short recap. Start with the decision. Then list action items with an owner and due date. Keep unresolved questions separate. Do not invent details.

Inline picker

Use an inline picker when search is part of the current task. Item activation inserts the exact record into the editable draft.

Meeting recap
Weekly update
Rewrite clearly

Groups and shortcut hints

Group related prompts and actions. Shortcut hints are visual only; the caller owns keyboard handling.

Meeting recap
R
Weekly update
W
Rewrite clearly
C
Start a new chat
N

Scrollable list

Keep a long collection in its own scroll region so search stays visible.

Meeting recap
Weekly update
Rewrite clearly
Project brief
Release notes
Customer response
Research summary
Decision record
Interview notes
Incident review
Launch checklist
Product comparison

No results

The collection has records, but the current query filters them all out. Edit the search to restore matching prompts.

No saved prompts match “travel plan”. Edit the search to see results.

Empty collection

Use this state when the caller has no prompt records yet. It differs from a query with no matches.

No saved prompts yet. Add one to use it here.

Disabled action

Show a disabled action when its context matters. It remains visible, is skipped by keyboard navigation, and cannot run.

Start a new chat
Delete conversation

API reference

Command.Root preserves Base UI's flat and grouped item inference. It renders no DOM. value and defaultValue are query strings, not selected record IDs. Root defaults are inline={true}, open={true}, autoHighlight="always", keepHighlight={true}, and submitOnItemClick={false}. Explicit values override these defaults.

Command.Item keeps Base UI item behavior and render/ref/state class support. Put the action on its onClick; do not infer a record from its display label. Arrow and pointer highlight events do not run the action. Native Enter uses the same item callback.