Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Command

Searchable actions with keyboard navigation and optional palette presentation.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Find a teammate

Search includes descriptive keywords; selecting a result updates the active assignee.

Open preview

Inline command

Type to filter, then use ArrowUp/Down and Enter.

Open preview

Palette

A modal command list. The shortcut opens it with Cmd/Ctrl+K; no trigger is required.

Open preview

Usage

Provide stable item ids, labels, optional groups and keywords. onSelect receives the selected item after the item's own onSelect callback.

Command is an inline search surface. CommandPalette adds the Dialog and an optional Cmd/Ctrl shortcut. Disable autofocus for inline examples that should not move focus on page load.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluCommandItem

Type source
PimoluCommandItem public API
NameTypeDefaultDescription
idRequiredstring—Stable identifier, also used to track the active option.
labelRequiredstring"Command palette"Primary text of the command.
descriptionstring | undefined—Optional secondary text shown under the label.
groupstring | undefined—Heading that groups related commands.
keywordsreadonly string[] | undefined—Extra search terms matched case-insensitively.
shortcutstring | undefined—Keyboard hint shown on the right, for example "Ctrl+K".
iconReactNode—Leading visual, hidden from assistive technology.
disabledboolean | undefined—Keep the command visible but prevent selecting it.
onSelect(() => void) | undefined—Called when the command is selected.
idRequired

string

No default extracted.

Stable identifier, also used to track the active option.

labelRequired

string

Default: "Command palette"

Primary text of the command.

description

string | undefined

No default extracted.

Optional secondary text shown under the label.

group

string | undefined

No default extracted.

Heading that groups related commands.

keywords

readonly string[] | undefined

No default extracted.

Extra search terms matched case-insensitively.

shortcut

string | undefined

No default extracted.

Keyboard hint shown on the right, for example "Ctrl+K".

icon

ReactNode

No default extracted.

Leading visual, hidden from assistive technology.

disabled

boolean | undefined

No default extracted.

Keep the command visible but prevent selecting it.

onSelect

(() => void) | undefined

No default extracted.

Called when the command is selected.

PimoluCommandProps

Type source
PimoluCommandProps public API
NameTypeDefaultDescription
itemsRequiredreadonly PimoluCommandItem[]—Public Pimolu prop; see the source declaration for details.
placeholderstring | undefined"Search commands..."Placeholder of the search field.
emptyMessagestring | undefined"No commands found."Message shown when no command matches the query.
aria-labelstring | undefined—Accessible name of the search field and the listbox.
onSelect((item: PimoluCommandItem) => void) | undefined—Called after the selected item's own `onSelect`.
classNamestring | undefined—Class applied to the command root.
autoFocusboolean | undefinedtrueFocus the search field on mount. Defaults to true.
itemsRequired

readonly PimoluCommandItem[]

No default extracted.

Public Pimolu prop; see the source declaration for details.

placeholder

string | undefined

Default: "Search commands..."

Placeholder of the search field.

emptyMessage

string | undefined

Default: "No commands found."

Message shown when no command matches the query.

aria-label

string | undefined

No default extracted.

Accessible name of the search field and the listbox.

onSelect

((item: PimoluCommandItem) => void) | undefined

No default extracted.

Called after the selected item's own `onSelect`.

className

string | undefined

No default extracted.

Class applied to the command root.

autoFocus

boolean | undefined

Default: true

Focus the search field on mount. Defaults to true.

PimoluCommandPaletteProps

Type source
PimoluCommandPaletteProps public API
NameTypeDefaultDescription
openboolean | undefined—Controlled open state. Omit to let the component own it.
defaultOpenboolean | undefinedfalseInitial open state when uncontrolled. Defaults to false.
onOpenChange((open: boolean) => void) | undefined—Called whenever the palette asks to open or close.
itemsRequiredreadonly PimoluCommandItem[]—Public Pimolu prop; see the source declaration for details.
labelstring | undefined"Command palette"Accessible name of the dialog and its search field.
shortcutstring | undefined—Key that opens the palette with Cmd/Ctrl, for example "k".
placeholderstring | undefined"Search commands..."Placeholder of the search field.
emptyMessagestring | undefined"No commands found."Message shown when no command matches the query.
onSelect((item: PimoluCommandItem) => void) | undefined—Called after the selected item's own `onSelect`.
classNamestring | undefined—Class applied to the dialog panel.
autoFocusboolean | undefinedtrueFocus the search field on mount. Defaults to true.
open

boolean | undefined

No default extracted.

Controlled open state. Omit to let the component own it.

defaultOpen

boolean | undefined

Default: false

Initial open state when uncontrolled. Defaults to false.

onOpenChange

((open: boolean) => void) | undefined

No default extracted.

Called whenever the palette asks to open or close.

itemsRequired

readonly PimoluCommandItem[]

No default extracted.

Public Pimolu prop; see the source declaration for details.

label

string | undefined

Default: "Command palette"

Accessible name of the dialog and its search field.

shortcut

string | undefined

No default extracted.

Key that opens the palette with Cmd/Ctrl, for example "k".

placeholder

string | undefined

Default: "Search commands..."

Placeholder of the search field.

emptyMessage

string | undefined

Default: "No commands found."

Message shown when no command matches the query.

onSelect

((item: PimoluCommandItem) => void) | undefined

No default extracted.

Called after the selected item's own `onSelect`.

className

string | undefined

No default extracted.

Class applied to the dialog panel.

autoFocus

boolean | undefined

Default: true

Focus the search field on mount. Defaults to true.

Accessibility

  • Provide aria-label for an inline Command, or label for CommandPalette.
  • Use arrows and Enter to select a result, and Escape to dismiss a palette. Do not claim a shortcut works unless your application registers or configures it.
Read the accessibility guide →