Exit out of a component

webflow.exitComponent()

Exit the focus of the Designer from a component definition. After exiting out of a component, the focus of the Designer will return to the body of the page.

Syntax

1webflow.exitComponent(): Promise<null>

Returns

Promise<null>

A Promise that resolves to null when the context switch is successful.

Example

1await webflow.exitComponent()
2const rootElement = await webflow.getRootElement()
3const rootElementType = rootElement?.type
4
5// Print Root Element Type. If element type is Body, the Designer has exited out of the Component context
6console.log(`Element Type: ${rootElementType}`)

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany