Get component by ID

webflow.getComponent(id)

Retrieves a component by its ID.

Syntax

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

Returns

Promise<Component>

A Promise that resolves to a component.

Example

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

Designer Ability

Checks for authorization only

Designer AbilityPermissionLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyanyany