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-public-latest';Signature:
export interface EmbedActionProperties
| Property | Type | Description | |
|---|---|---|---|
| actionEl | HTMLElement | Element for the action itself. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| onClick(callback) | this | Register a click handler for the action. | |
| setClass(cls) | this | Set an additional CSS class on the action element. | |
| setIcon(icon) | this | Set the icon of the action. | |
| setTooltip(tooltip) | this | Set the tooltip shown when hovering the action. |