Skip to content

SettingDefinitionPage<K>

Official

A declarative page of settings rendered as a navigable entry. Used as an inline page in the array returned by getSettingDefinitions().

Import:

import type { SettingDefinitionPage } from 'obsidian';

Signature:

export interface SettingDefinitionPage<K extends string = string>

Properties

Property Type Description
desc? DocumentFragment | string Description shown on the navigable entry.
displayValue? (() => string) | string Surfaces the current value on the entry, so the user can see it without opening the page where it is edited. Call update() on the setting tab to refresh it after the value changes.
items? SettingDefinitionItem<K>[] Inline items rendered as a declarative sub-page. Can include groups and nested pages. Mutually exclusive with page.
name string Display name shown as the navigable entry and page title.
page? () => SettingPage Factory for a custom SettingPage subclass. Use this when the sub-page is rendered imperatively rather than from a list of definitions. Mutually exclusive with items. The factory is called each time the page is opened.
status? 'warning' | (() => 'warning' | null) | null Adds a status indicator to the entry. Use 'warning' when the value on the page needs the user's attention. Call update() on the setting tab to refresh it after the underlying state changes.
type 'page' Discriminant identifying this item as a page.
visible? (() => boolean) | boolean Controls whether the page link is rendered. false or () => false hides the navigable entry. Evaluated on each render.