component.getName()

Get the name of the Component Object.

Syntax

1component.getName(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string representing the name of a component.

1const myComponentName = "Hero-Component";
2const components = await webflow.getAllComponents();
3
4// Check if component exists
5for (const c in components) {
6 const currentComponentName = await components[c].getName();
7 if (myComponentName === currentComponentName) {
8 console.log("Found Hero Component");
9 }
10}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany