Skip to content

SettingGroup

Official

Setting group.

Import:

import { SettingGroup } from 'obsidian';

Signature:

export class SettingGroup

Constructor

new SettingGroup(containerEl: HTMLElement)

Constructor.

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

Properties

PropertyTypeDescription
componentsBaseComponent[]The components of the setting group.
controlElHTMLDivElementThe control element of the setting group.
groupElHTMLDivElementThe group element of the setting group.
headerElHTMLDivElementThe header element of the setting group.
headerInnerElHTMLDivElementThe header inner element of the setting group.
listElHTMLElementThe list element of the setting group.

Methods

MethodReturnsDescription
addClass(classes?)thisAdd CSS classes to the setting group.
addExtraButton(cb)thisAdd an extra button to the setting group.
addSearch(cb)thisAdd a search input at the beginning of the setting group. Useful for filtering results or adding an input for quick entry.
addSearchControl(cb)thisAdds a search control to the setting group's header.
addSetting(cb)thisAdd a setting to the setting group.
focusNearestItem(index)voidFocuses the nearest visible item at or after the given index.
onDeleteItem(cb)thisRegisters a handler invoked when an item is deleted via the keyboard.
onReorderItem(cb)thisRegisters a handler invoked when an item is reordered via the keyboard.
setHeading(text)thisSet the heading of the setting group.

Links to this page: