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

PropertyTypeDescription
disabledbooleanWhether the component is disabled.
(Inherited from BaseComponent)
extraSettingsElHTMLElementThe HTML element representation of the extra button.

Methods

MethodReturnsDescription
changeCallback()voidThe function that's called after clicking the button.
onClick(callback)thisSet the click callback of the extra button.
setDisabled(disabled)thisSet the disabled state of the extra button.
setIcon(icon)thisSet the icon of the extra button.
setTooltip(tooltip, options?)thisSet the tooltip of the extra button.
then(cb)thisFacilitates chaining.
(Inherited from BaseComponent)

Links to this page: