APIsChangelog
Log In
APIs

Get root element

component.getRootElement()

Retrieves the root element of the component.

Syntax

webflow. getRootElement(): Promise<null | AnyElement>;

Returns

Promise< AnyElement>

A Promise that resolves to the root element.

Example

// Get Component
const all = await webflow.getAllComponents()
const firstComponent = all[0]

// Get Root Element of Component
const root = await firstComponent?.getRootElement()
console.log(root)

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany