Designer API
Control the Webflow Designer
element.getComponent()
Retrieves the associated component definition of the component instance.
1element.getComponent(): Promise<Component>
Promise<Component>
A Promise that resolves to a Component Object
1// Select Component Element on Page2const elements = await webflow.getAllElements()3const componentInstance = elements.find(el => el.type === 'ComponentInstance')45if (componentInstance?.type === "ComponentInstance") {67 // Get Component object from instance8 const component = await componentInstance?.getComponent()9 const componentName = await component.getName()10 console.log(componentName)11} else {12 console.log("No component element found")13}
Checks for authorization only