Skip to content

obsidian/components/plugin-settings-component

Component that manages plugin settings: data, persistence, validation, and events.

This is the single public-facing settings API for plugin authors. All settings logic (load, save, validate, transform, clone) is handled directly by this component — no separate manager class is needed.

ClassDescription
PluginSettingsComponentBaseBase class for plugin settings components. Manages settings data, persistence, validation, and events. Plugin authors extend this class and implement createDefaultSettings.
InterfaceDescription
PluginSettingsComponentBaseConstructorParamsConstructor parameters for PluginSettingsComponentBase.
PluginSettingsComponentBaseOnSaveSettingsParamsParameters for PluginSettingsComponentBase.onSaveSettings.
PluginSettingsStateA snapshot of plugin settings state, including raw input values, effective (validated) values, and per-property validation messages.
TypeDescription
ReadonlyPluginSettingsReadonly version of PluginSettings.
ReadonlyPluginSettingsStateReadonly version of PluginSettingsState for use in event callbacks and public getters.
SettingsValidatorA validator function for a settings property.