component.setName(name)

Set the name of the Component Object.

Syntax

1component.setName(name: string): Promise<void>

Parameters

  • name : string - Then name you wish to give your component

Returns

Promise<null>

A promise that resolves to null once the name has been set.

1// Get Component
2const components = await webflow.getAllComponents()
3const myComponent = components[0]
4
5// Set Component Name
6await myComponent.setName("My New Component Name")

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyComponentsanyanyCanvasDesign