webflow.unregisterComponent(component)
webflow.unregisterComponent(component)
Removes a component definition from the site.
Syntax
webflow.unregisterComponent(component: Component): Promise<null>
Parameters
component
: Component - The component to delete
Returns
Promise<null
>
A promise that resolves to null
.
Example
// Get selected element
const selectedElement = await webflow.getSelectedElement();
if (selectedElement) {
// Create component from selected element
const myNewComponent = await webflow.registerComponent('Hero Component', selectedElement);
// Delete Component
await webflow.unregisterComponent(myNewComponent);
} else {
console.log("No element is currently selected. Please select a root element first.");
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canCreateComponents | Primary | any | Canvas | any |