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

Search for Components (Beta)

Was this page helpful?
Previous

Get the selected component (Beta)

Next
Built with

webflow.searchComponents(options)

Searches for Components in a way similar to the search box in the Components panel in the Webflow Designer.

This command returns Components in the same order as a search in the Components panel and uses the same search logic. It searches fields including the name and description.

Beta

These methods are in public beta and may change with future releases.

Syntax

1interface SearchComponentsOptions {
2 /** Fuzzy search query matching Component panel search behavior */
3 q?: string;
4}
5interface ComponentLibrary {
6 name: string;
7 id: string;
8}
9interface ComponentSearchResult {
10 id: string;
11 name: string;
12 group: string;
13 description: string;
14 instances: number;
15 canEdit: boolean;
16 library: ComponentLibrary | null;
17}
18
19webflow.searchComponents(options: SearchComponentsOptions?): Promise<Array<ComponentSearchResult>>

Returns

Promise<Array<ComponentSearchResult>>

A Promise that resolves to an array or objects with information about matching Components, not the Component objects themselves.

Example

1// Get all Components
2const allComponents = await webflow.searchComponents();
3/*
4[
5 {
6 id: 'xxxx',
7 name: 'Hero section',
8 group: 'Sections',
9 description: 'Lorem ipsum',
10 instances: 3,
11 canEdit: true,
12 library: null,
13 },
14 {
15 id: 'yyyy',
16 name: 'Nav Bar',
17 group: 'Navigation',
18 description: '',
19 instances: 5,
20 canEdit: false,
21 library: { name: 'Core Library', id: 'lib_123' },
22 },
23]
24*/
25
26// Search for Components by query
27const heroes = await webflow.searchComponents({ q: 'Hero' });
28/*
29[
30 {
31 id: 'xxxx',
32 name: 'Hero section',
33 group: 'Sections',
34 description: 'Lorem ipsum',
35 instances: 3,
36 canEdit: true,
37 library: null,
38 },
39]
40*/

Try this example


Designer Ability

Checks for authorization only

Designer AbilityPermissionLocaleBranchWorkflowSitemode
canAccessCanvasanyanyanyanyany