Skip to content

SettingPage

Official

Base class for a sub-page within a SettingTab. Use with the page factory on SettingDefinitionPage to render a sub-page imperatively — useful when the page’s content is dynamic or doesn’t fit cleanly into a list of definitions.

For declarative sub-pages, use the items field on SettingDefinitionPage instead.

Import:

import { SettingPage } from 'obsidian';

Signature:

export class SettingPage

Properties

Property Type Description
containerEl HTMLElement Container for the page's content. Render into this element from display.
rootEl HTMLElement
title string Title displayed in the page titlebar.
titlebarEl HTMLElement

Methods

Method Returns Description
display() void Called when the page is opened. Clears and re-renders content into containerEl.
hide() void Hides 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: