webflow.unregisterComponent(component)

Removes a component definition from the site.

Syntax

1webflow.unregisterComponent(component: Component): Promise<null>

Parameters

  • component : Component - The component to delete

Returns

Promise<null>

A promise that resolves to null.

Example

1// Get selected element
2const selectedElement = await webflow.getSelectedElement();
3
4if (selectedElement) {
5
6 // Create component from selected element
7 const myNewComponent = await webflow.registerComponent('Hero Component', selectedElement);
8
9 // Delete Component
10 await webflow.unregisterComponent(myNewComponent);
11
12} else {
13 console.log("No element is currently selected. Please select a root element first.");
14}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canCreateComponentsPrimaryanyCanvasany