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
      • Get all components
      • Get component by name
      • Get component by ID
      • Search for components
      • Get the selected component
      • Get all variants of a component
      • Get selected variant
      • Get a variant by ID
      • Create a variant
      • Set variant settings
      • Reorder variants
      • Delete a variant
      • Get component instance count
      • Create a component
      • Delete a component
  • 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.unregisterComponent(component)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ComponentsCreating & Retrieving Components

Delete a component

Was this page helpful?
Previous

Create a component instance

Next
Built with

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}

Try this example


Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canCreateComponentsPrimaryanyCanvasany