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
      • Create a component instance
      • Open a component canvas
      • Set the selected variant
      • Select a component
      • Exit out of a component
      • Get root element
      • Get component name
      • Get component
      • Set component name
      • Get component settings
      • Set component settings
      • Get props
      • Create a prop
      • Create multiple props
      • Get a prop
      • Get a prop by name
      • Set prop settings
      • Remove a prop
  • 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
  • Example
  • Designer Ability
ComponentsManaging Components

Create a component instance

Was this page helpful?
Previous

Open a Component canvas (Beta)

Next
Built with

Adding a component instance, also known as a ComponentElement, to the canvas resembles the same process as adding any element to the canvas. Use the element creation methods in combination with a Component Object to create a new Component Instance.

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement()
3
4// Get Component
5const allComponents = await webflow.getAllComponents()
6const firstComponent = allComponents[0]
7
8// Add Component instance onto a page
9await selectedElement?.before(firstComponent)

Try this example


Designer Ability

Designer AbilityLocaleBranchWorkflowSiteMode
canCreateComponentsprimaryanycanvasany