Skip to content

EmbedAction

Unofficial

Builder for a single action in a widget’s action bar.

Handed to the ObsidianWidgetType.addAction callback, it wraps one div.embed-action inside the div.embed-actions bar.

Despite the fluent setters, this is not an obsidian#BaseComponent - it has no base class at all, and none of the component lifecycle.

Import:

import type { EmbedAction } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface EmbedAction

Properties

PropertyTypeDescription
actionElHTMLElementElement for the action itself.

Methods

MethodReturnsDescription
onClick(callback)thisRegister a click handler for the action.
setClass(cls)thisSet an additional CSS class on the action element.
setIcon(icon)thisSet the icon of the action.
setTooltip(tooltip)thisSet the tooltip shown when hovering the action.