CommandPalette API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
CommandPalette9 props2 callbacks0 methods
Preset and CSS
Set preset.className to attach your CSS class to the component's rendered surface. Explicit component props take precedence over preset options.
CSS parts in the example [data-part="root"]
Use styles.root and styles.parts in a theme and generate a CSS file with themeToCss. For other JSON-friendly component props, spread presetProps(preset) before explicit props. Parts and states depend on configuration; the gallery shows those visible in the current preview.
Props9
| Name | Type | Description |
|---|---|---|
openOptional | boolean | undefined | Whether the dialog is open. |
labelRequired | string | Localized dialog or inline palette title. |
searchLabelRequired | string | Localized search label and placeholder. |
closeLabelOptional | string | undefined | Localized close action. |
emptyLabelRequired | string | Localized empty-results message. |
commandsRequired |
| Commands in display order. Commands with the same group appear together. |
inlineOptional | boolean | undefined | Show a persistent inline command list. Dialog props are ignored in this mode. |
loopOptional | boolean | undefined | Wrap arrow navigation at the beginning and end of the results. |
presetOptional |
| Optional presentation preset. |
Events and callbacks2
| Name | Type | Description |
|---|---|---|
onCloseOptional |
| Called when the dialog closes. |
onExecuteRequired |
| Called when an enabled command is activated. |
Methods0
No component-specific imperative methods. Use props and callbacks to control this component.