For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
      • Create a component instance
      • Open a component canvas
      • Set the selected variant
      • Select a component
      • Exit out of a component
      • Get root element
      • Get component name
      • Get component
      • Set component name
      • Get component settings
      • Set component settings
      • Get props
      • Create a prop
      • Create multiple props
      • Get a prop
      • Get a prop by name
      • Set prop settings
      • Remove a prop
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • webflow.exitComponent()
  • Syntax
  • Returns
  • Example
  • Designer Ability
ComponentsManaging Components

Exit out of a component

Was this page helpful?
Previous

Get root element

Next
Built with

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}`)

Try this example


Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyany