Get display name (Beta)

element.getDisplayName()

Get the user-facing display name of an element as shown in the Navigator panel.

Beta

These methods are in public beta and may change with future releases.

Syntax

1element.getDisplayName(): Promise<null | string>

Returns

  • Promise<String>: If the element has a custom display name, a promise that resolves to that name.
  • Promise<null>: If the element is using its default name, a promise that resolves to null.

Example

1// Get the selected element
2const element = await webflow.getSelectedElement();
3
4if (element?.displayName) {
5
6 // Get the element's display name
7 const name = await element.getDisplayName();
8 console.log(name); // 'Hero Wrapper' or null
9}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny