Updates to components API
These new and updated functions are now available in the Designer API (Beta):
webflow.registerComponent(): You can now create a component without passing a root elementwebflow.getComponent(id): This new function returns a component by its IDcomponent.getInstanceCount(): This new function gets the total number of instances of a component across an entire site
Creating functions without passing a root element
You can now create a component with the webflow.registerComponent() function without passing a root element.
Instead, you can pass an object with the name for the new component and optionally a group and description, as in this example:
For more information, see Create a component.
Getting components by ID
Previously, to access a component in the Designer API, you had to get a list of components with the webflow.getAllComponents() function and filter by ID.
Now you can use the webflow.getComponent(id) function to get a component by its ID, as in this example:
For more information, see Get component by ID.
Getting the number of instances of a component
You can now get the total number of instances of a component across an entire site with the webflow.getInstanceCount() function:
For more information, see Get component instance count.