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.getAllComponents()
  • Syntax
  • Returns
  • Example
  • Designer Ability
ComponentsCreating & Retrieving Components

Get all components

Was this page helpful?
Previous

Get component by name (Beta)

Next
Built with

webflow.getAllComponents()

Retrieves all component objects registered to the site.

Syntax

1webflow.getAllComponents(): Promise<Array<Component>>

Returns

Promise<Array<Component>>

A Promise that resolves to an array of components.

Example

1// Get all components
2const components = await webflow.getAllComponents();
3
4// Print Component Details
5if (components.length > 0) {
6
7 console.log("List of registered components:");
8
9 for (let component in components) {
10 const currentComponentName = await components[component].getName();
11 console.log(`${component + 1}. Component Name: ${currentComponentName}, Component ID: ${components[component].id}`);
12 }
13} else {
14 console.log("No components are currently registered.");
15}

Try this example


Designer Ability

Checks for authorization only

Designer AbilityPermissionLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyanyany