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 the selected component (Beta)

webflow.getCurrentComponent()

Retrieves the component that is currently being edited.

Beta

These methods are in public beta and may change with future releases.

Syntax

1webflow.getCurrentComponent(): Promise<Component | null>

Returns

Promise<Component>

A Promise that resolves to a component or null if no component is currently being edited.

Example

1const component = await webflow.getCurrentComponent();
2if (component) {
3 const name = await component.getName();
4 console.log(`Currently editing component: ${name}`);
5 // Example: get all elements inside the active component
6 const root = await component.getRootElement();
7 const children = await root.getChildren();
8 console.log(`Root has ${children.length} child element(s)`);
9} else {
10 console.log('Not currently editing a component.');
11}

Designer Ability

Checks for authorization only

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