Get component by ID

webflow.getComponent(id)

Retrieves a component by its ID.

Syntax

webflow.getComponent(id: ComponentId): Promise<Component>

Returns

Promise<Component>

A Promise that resolves to a component.

Example

const componentId = '4a669354-353a-97eb-795c-4471b406e043';
const component = await webflow.getComponent(componentId);
console.log(component.id); // '4a669354-353a-97eb-795c-4471b406e043'
const componentName = await component.getName();
console.log(componentName); // 'Component Name'

Designer Ability

Checks for authorization only

Designer AbilityPermissionLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyanyany