Skip to content

AppSetting

Unofficial

The settings modal for the application, managing core and plugin setting tabs.

Import:

import type { AppSetting } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface AppSetting extends Modal

Extends: Modal

Constructor

new AppSetting(app: App)

Constructor.

To get the constructor instance, use getAppSettingConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
activeTabnull | SettingTabCurrent active tab of the settings modal.
appAppThe Obsidian app instance.
(Inherited from Modal)
backButtonElHTMLElementBack button element shown in the title bar when a sub-page is open.
bgElHTMLElementBackground applied to application to dim it
(Inherited from Modal)
bgOpacitystringOpacity percentage of the background
(Inherited from Modal)
communityPluginTabContainerHTMLElementContainer element containing the community plugins
communityPluginTabHeaderGroupHTMLElementContainer element containing the community plugins header.
containerElHTMLElementThe container HTML element for the modal.
(Inherited from Modal)
contentElHTMLElementThe HTML element that represents the content of the modal.
(Inherited from Modal)
corePluginTabContainerHTMLElementContainer element containing the core plugins.
corePluginTabHeaderGroupHTMLElementContainer element containing the core plugins header.
dimBackgroundbooleanWhether the background is being dimmed
(Inherited from Modal)
feedbackBannerunknownFeedback banner element.
hasInitialInputFocusbooleanWhether the modal focuses its first input when opened.
(Inherited from Modal)
headerElHTMLDivElementHeader element of the modal dialog.
(Inherited from Modal)
isSearchActivebooleanWhether the settings search is currently active.
lastTabIdstringPreviously opened tab ID.
lastVimGTimestampnumberTimestamp of the last Vim g keypress, used to detect gg.
modalElHTMLElementThe HTML element that represents the modal.
(Inherited from Modal)
pageStackunknown[]The stack of open sub-pages.
pluginTabsSettingTab[]List of all plugin tabs (core and community, ordered by precedence).
popoutunknownThe popout-window handle when the settings are popped out, or null.
popoutStorageKeystringThe local-storage key used to persist the popout-window state.
quitRefEventRef | nullThe event reference for the workspace quit hook, or null.
scopeScopeThe scope for the keymaps.
(Inherited from Modal)
searchComponentSearchComponentThe search input component.
searchIndexunknownThe internal index used to search settings.
searchNavItemsunknown[]The navigable items shown for the current search results.
searchResultsElHTMLElementThe container element for search results.
selectionnull | WindowSelectionSelection logic handler
(Inherited from Modal)
settingTabsSettingTab[]List of all core settings tabs (editor, files & links, ...).
shouldAnimatebooleanWhether the modal should animate
(Inherited from Modal)
shouldRestoreSelectionbooleanWhether the modal should restore the selection when it is opened or closed.
(Inherited from Modal)
tabContainerHTMLElementContainer element containing the core settings.
tabContentContainerHTMLElementContainer for currently active settings tab.
tabGroupContainerElHTMLElementThe container element for the vertical tab header group.
tabHeadersElHTMLElementContainer for all settings tabs.
tabNavItemsunknown[]The navigable tab items in the sidebar.
titleElHTMLElementThe HTML element that represents the title of the modal.
(Inherited from Modal)
titleTextElHTMLElementThe element displaying the current page title.
unloadHandler(() => void) | nullThe beforeunload handler registered while popped out, or null.
winnull | WindowReference to the global Window object.
(Inherited from Modal)

Methods

MethodReturnsDescription
activateNavItem(el)voidActivates the navigable nav item matching the given element.
activateSettingItem(el)voidActivates the setting item for the given element (clicks it).
addSettingTab(tab)voidAdd a new plugin tab to the settings modal.
animateClose()Promise<void>Performed when animation is complete
(Inherited from Modal)
animateOpen()Promise<void>Performed when animation is started
(Inherited from Modal)
clearPageStack()voidCloses and hides every open sub-page.
close()voidClose the modal.
(Inherited from Modal)
closeActiveTab()voidCloses the currently active tab.
closePage()voidCloses the top-most sub-page.
focusNavItem(navItem)voidFocuses the given nav item.
focusNextNavItem(direction)voidMoves focus to the nav item at the given offset from the current one.
focusNextSettingItem(settingEl, direction)voidMoves focus to the setting item at the given offset from the given one.
focusSettingItem(settingEl, focusVisible?)voidFocuses the given setting item element.
focusSidebar()voidMoves focus to the sidebar.
getCurrentPageEl()HTMLElement | undefinedGets the root element of the current page.
getNavigableNavItems()unknown[]Gets the currently navigable nav items (search results or tabs).
getNavigableSettingItems()HTMLElement[]Gets the currently navigable setting item elements.
getPopoutOptions()unknownGets the options used when popping the settings out into a window.
getRootEl()HTMLElementGets the modal's root element.
(Inherited from Modal)
isPluginSettingTab(tab)booleanCheck whether tab is a plugin tab.
navigateToSearchResult(result, hit?)voidNavigates to a search result, optionally scrolling to a specific definition.
onClickOutside(evt)voidCloses the modal when a click occurs outside of it, unless the event was already handled.
(Inherited from Modal)
onClose()voidCalled when the modal is closed.
(Inherited from Modal)
onEscapeKey()voidOn escape key press close modal
(Inherited from Modal)
onHistoryBack()voidCalled when the user navigates back in the history.
(Inherited from Modal)
onHistoryForward()voidCalled when the user navigates forward in the history.
(Inherited from Modal)
onOpen()Promise<void> | voidCalled when the modal is opened.
(Inherited from Modal)
onSearchChanged()voidHandles a change to the search query.
onWindowClose()voidOn closing of the modal
(Inherited from Modal)
open()voidShow the modal on the the active window. On phones, the modal will animate on screen.
(Inherited from Modal)
openPage(page)voidOpens a sub-page.
openTab(tab)voidOpen a specific tab by tab reference.
openTabById(id)HotkeysSettingTabOpen the hotkeys setting tab by ID.
openTabById(id)SettingTabOpen a specific tab by ID.
rebuildTabNavItems()voidRebuilds the sidebar tab nav items.
refreshCurrentPage(tab)voidRe-renders the current page for the given tab if it is active.
refreshSearch()voidRe-runs the current search.
removeSettingTab(tab)voidRemove a plugin tab from the settings modal.
scrollToDefinition(tab, definition)voidScrolls to and focuses a setting definition within a tab.
setBackgroundOpacity(opacity)thisSet the background opacity of the dimmed background.
(Inherited from Modal)
setCloseCallback(callback)thisSet the callback to be called when the modal is closed.
(Inherited from Modal)
setContent(content)thisSet the content of the modal.
(Inherited from Modal)
setDimBackground(dim)thisSet whether the background should be dimmed.
(Inherited from Modal)
setTitle(title)thisSet the title of the modal.
(Inherited from Modal)
updateModalTitle(tab)voidUpdate the title of the modal.
updatePageTitle()voidUpdates the displayed page title from the current page or active tab.
updatePluginSection()voidUpdate a tab section.

Links to this page: