ComponentElement.getComponent()

Get the Component Definition that is associated to a Component Instance

Syntax

1element.getComponent(): Promise<Component>

Returns

Promise<Component>

A promise that resolves to a Component Object associated with a Component Instance.

1//Get User Selected Element from the Designer
2const parent = await webflow.getSelectedElement();
3
4// Check if this selected element is a Component Instance
5if(parent && !parent.configurable && parent.type === 'ComponentInstance'){
6 console.log(await parent.getComponent().getName());
7 }

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany