Skip to content

CommandPaletteModal

Unofficial

Fuzzy suggest modal used by the command palette to search and execute commands.

Import:

import type { CommandPaletteModal } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface CommandPaletteModal extends FuzzySuggestModal<Command>

Extends: FuzzySuggestModal<Command>

Constructor

new CommandPaletteModal(app: App)

Constructor.

To extract the constructor type, use ExtractConstructor<FuzzySuggestModal>.

Properties

PropertyTypeDescription
chooserSuggestModalChooser<FuzzyMatch<Command>, this>The suggestion chooser that manages selection and rendering.
(Inherited from FuzzySuggestModal)
clearButtonElHTMLDivElementButton element to clear the input field.
(Inherited from FuzzySuggestModal)
commandsCommand[] | nullCached list of available commands, or null if not yet populated.
ctaElHTMLDivElementCall-to-action element displayed in the modal.
(Inherited from FuzzySuggestModal)
emptyStateTextstringThe text to display when there are no suggestions.
(Inherited from FuzzySuggestModal)
inputElHTMLInputElementThe input element.
(Inherited from FuzzySuggestModal)
instructionsElHTMLDivElementElement displaying keyboard shortcut instructions.
(Inherited from FuzzySuggestModal)
isOpenbooleanWhether the suggest modal is currently open.
(Inherited from FuzzySuggestModal)
limitnumberThe limit of the number of suggestions.
(Inherited from FuzzySuggestModal)
pluginCommandPalettePluginInstanceReference to the command palette plugin instance.
resultContainerElHTMLElementThe result container element.
(Inherited from FuzzySuggestModal)

Methods

MethodReturnsDescription
getItems()Command[]Get the items to be used in the fuzzy search.
(Inherited from FuzzySuggestModal)
getItemText(item)stringGet the text to be used in the fuzzy search.
(Inherited from FuzzySuggestModal)
getSuggestions(query)FuzzyMatch<Command>[]Get the suggestions for the fuzzy match.
(Inherited from FuzzySuggestModal)
onChooseItem(item, evt)voidCalled when an item is chosen.
(Inherited from FuzzySuggestModal)
onChooseSuggestion(item, evt)voidCalled when a suggestion is chosen.
(Inherited from FuzzySuggestModal)
onChooseSuggestion(item, evt)voidChoose a suggestion.
(Inherited from FuzzySuggestModal)
onInput()voidHandle input change in the suggest modal.
(Inherited from FuzzySuggestModal)
onNoSuggestion()voidSet the callback to be called when there are no suggestions.
(Inherited from FuzzySuggestModal)
onSelectedChange(value, evt?)voidCalled after every selection change, including the programmatic one that follows SuggestModalChooser.setSuggestions.
(Inherited from FuzzySuggestModal)
renderSuggestion(item, el)voidRender the suggestion.
(Inherited from FuzzySuggestModal)
renderSuggestion(value, el)voidRender a suggestion.
(Inherited from FuzzySuggestModal)
selectActiveSuggestion(evt)voidSelect the active suggestion.
(Inherited from FuzzySuggestModal)
selectSuggestion(value, evt)voidSelect a suggestion.
(Inherited from FuzzySuggestModal)
setInstructions(instructions)voidSet the instructions.
(Inherited from FuzzySuggestModal)
setPlaceholder(placeholder)voidSet the placeholder text.
(Inherited from FuzzySuggestModal)
sortSuggestions(suggestions)voidSorts the fuzzy-match suggestions, highest score first.
(Inherited from FuzzySuggestModal)
updateSuggestions()voidRefresh the displayed suggestions based on the current query.
(Inherited from FuzzySuggestModal)

Links to this page: