Skip to content

ExtraButtonComponent

Official

Extra button component, for secondary actions.

Import:

import { ExtraButtonComponent } from 'obsidian';

Signature:

export class ExtraButtonComponent extends BaseComponent

Extends: BaseComponent

Constructor

new ExtraButtonComponent(containerEl: HTMLElement)

Constructor.

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

Properties

Property Type Description
disabled boolean Whether the component is disabled.
(Inherited from BaseComponent)
extraSettingsEl HTMLElement The HTML element representation of the extra button.

Methods

Method Returns Description
changeCallback() void The function that's called after clicking the button.
onClick(callback) this Set the click callback of the extra button.
setDisabled(disabled) this Set the disabled state of the extra button.
setIcon(icon) this Set the icon of the extra button.
setTooltip(tooltip, options?) this Set the tooltip of the extra button.
then(cb) this Facilitates chaining.
(Inherited from BaseComponent)

Links to this page: