Designer API
Control the Webflow Designer
component.getRootElement()
Retrieves the root element of the component.
1webflow. getRootElement(): Promise<null | AnyElement>;
Promise< AnyElement>
A Promise that resolves to the root element.
1// Get Component2const all = await webflow.getAllComponents()3const firstComponent = all[0]45// Get Root Element of Component6const root = await firstComponent?.getRootElement()7console.log(root)
Try this example
Checks for authorization only