APIsChangelog
Log In

Set component name

component.setName(name)

Set the name of the Component Object.

Syntax

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

Parameters

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

Returns

Promise<void>

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

// Get Component
const components = await webflow.getAllComponents()
const myComponent = components[0]

// Set Component Name
await myComponent.setName("My New Component Name")