Search for Components

You can now use the webflow.searchComponents(options) method (Beta) to search for Components by name or description. If you don’t provide a search parameter, the method returns all Components. If you provide a string search parameter as in the following example, the method returns Components with matching names or descriptions.

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*/

For more information, see Search for Components.