Skip to content

SettingPage

Official

Base class for sub-pages of a SettingTab.

Import:

import { SettingPage } from 'obsidian';

Signature:

export class SettingPage

Constructor

new SettingPage()

Creates a new instance of SettingPage.

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

Properties

PropertyTypeDescription
containerElHTMLElementContainer for the page's content. Render into this element from display.
rootElHTMLElementThe root element of the page.
titlestringTitle displayed in the page titlebar.
titlebarElHTMLElementThe titlebar element of the page.

Methods

MethodReturnsDescription
display()voidCalled when the page is opened. Clears and re-renders content into containerEl.
hide()voidHides the contents of the page. Any registered components should be unloaded when the page is hidden. Override this if you need to perform additional cleanup.

Called when the user navigates away, the containing tab is switched, or the settings modal is closed. Not guaranteed to run when the host window is destroyed.

Links to this page: