For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo

Get all elements

webflow.getAllElements()

Retrieve all elements present on the current page of the Designer.

If the Designer is editing a component, the elements returned are those present in that Component.

Syntax

1webflow.getAllElements(): Promise<Array<AnyElement>>

Returns

Promise<AnyElement>

A Promise that resolves to an array of AnyElement objects.

AnyElement represents the various element types available in a Webflow project. See a full list of supported element types in the Designer Extension type definitions.

Example

1// Retrieve all elements in the current context
2const allElements = await webflow.getAllElements();
3
4// Print element list
5if (allElements.length > 0) {
6 console.log("List of all elements:");
7
8 allElements.forEach((element, index) => {
9 console.log(`${index + 1}. Element ID: ${element.id}, Element Type: ${element.type}`);
10 });
11} else {
12 console.log("No elements found in the current context.");
13}

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Morty Proxy This is a proxified and sanitized view of the page, visit original site.