Setting.addButton method
Setting › addButton
Official
Add a button to the setting.Signature:
addButton(cb: (component: ButtonComponent) => unknown): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| cb | (component: ButtonComponent) => unknown | The callback to add the button. |
Returns: this — The setting. To get the constructor instance, use getSettingConstructor from obsidian-typings/implementations.
Since: 0.9.7
Example:
setting.addButton((button) => { button.setText('foo');});