Skip to content

SelectItemParams<T>

Options for selectItem.

Import:

import type { SelectItemParams } from '@mnaoumov/obsidian-lib/modals/select-item';

Signature:

export interface SelectItemParams<T> extends ModalParamsBase

Extends: ModalParamsBase

Properties

PropertyTypeDescription
appAppAn Obsidian app instance.
(Inherited from ModalParamsBase)
cssClasses?string[]A CSS class to apply to the modal.
(Inherited from ModalParamsBase)
itemsT[]A list of items to choose from.
itemTextFunction(item: T) => stringGet the display text for each item
placeholder?stringA placeholder text for the input field.
spellcheckMode?SpellcheckModeThe mode deciding whether the search box is spell-checked.

The default is what this modal has always done, so passing nothing changes nothing. It differs from the prompt() parameter's default on purpose: Obsidian builds every SuggestModal input with a hardcoded spellcheck="false" and never consults Editor > Spellcheck there, so Off — not FollowObsidianSetting — is the value that leaves the box exactly as Obsidian built it.

Raise it for a picker whose box can NAME the thing it is about to create, rather than only find one.

Links to this page: