Search props

element.searchProps()

Search the props on a component instance and return the information about matching props. Results are returned in the same order as the instance props panel on the canvas.

This method is the instance-level counterpart to getProps() on the component definition. While getProps() returns prop definitions, searchProps() returns prop values as they exist on a specific instance.

Syntax

1element.searchProps(options?: { valueType?: BindableValueType }): Promise<Array<InstanceProp>>

Related interfaces:

1interface InstanceProp {
2 /** The prop's ID (matches the ID from the component's getProps/createProp). */
3 propId: string;
4 /** The binding value type (e.g. "string", "boolean", "textContent"). */
5 valueType: BindableValueType;
6 /** Whether this instance has overridden the default value for this prop. */
7 hasOverride: boolean;
8 /** The current value — always a { sourceType, ... } shape. */
9 value: SettingValue;
10 /** The final resolved value (never a binding reference). null if unresolvable. */
11 resolvedValue: ResolvedValue | null;
12 /** The default value from the component definition. */
13 defaultValue: ResolvedValue | null;
14 /** Display metadata for rendering in UI. */
15 display: SettingDisplay;
16}
17
18type SettingValue = StaticPropValue | BindingValue;
19
20interface StaticPropValue {
21 sourceType: 'static';
22 value: ResolvedValue | null;
23}
24
25type BindingValue =
26 | { sourceType: 'prop'; propId: string; propName: string; propGroup: string | null }
27 | { sourceType: 'cms'; collectionId: string; collectionName: string; fieldId: string; fieldName: string; fieldGroup: string | null; fieldType: CmsFieldType }
28 | { sourceType: 'locale'; fieldKey: string; fieldName: string; fieldType: 'string' }
29 | { sourceType: 'localeItem'; fieldKey: string; fieldName: string; fieldType: 'string' }
30 | { sourceType: 'page'; fieldKey: string; fieldName: string }
31 | { sourceType: 'conditional' }
32 | { sourceType: 'legacy' };
33
34type ResolvedValue =
35 | string
36 | number
37 | boolean
38 | null
39 | LinkResolvedValue
40 | VideoResolvedValue
41 | RichTextResolvedValue;
42
43interface SettingDisplay {
44 label: string;
45 group: string | null;
46 trueLabel?: string;
47 falseLabel?: string;
48}

Parameters

options (optional)

PropertyTypeDescription
valueTypeBindableValueTypeFilter results to props with an exact match on value type. Accepted values: "text", "boolean", "imageAsset", "link", "video", "richText", "file", "lottieAsset", "riveAsset".

Returns

Promise<Array<InstanceProp>>

A Promise that resolves to an array of InstanceProp objects in panel display order.

Each InstanceProp has the following fields:

FieldTypeDescription
propIdstringThe prop’s ID. Matches the ID from the component definition’s getProps().
valueTypeBindableValueTypeThe binding value type of the prop.
bindableToreadonly BindableValueType[]The value types that this prop can bind to.
hasOverridebooleanWhether this instance has overridden the component’s default value for this prop.
valueStaticValue | BindingValueThe current value. Always a { sourceType, ... } shape — see the table below.
resolvedValueunknown | nullThe final resolved value. Never a binding reference. null if unresolvable.
defaultValueunknown | nullThe default value from the component definition.
displayInstancePropDisplayDisplay metadata for rendering in UI. Includes label, group, and optional trueLabel and falseLabel for boolean props.

The value field always uses a { sourceType, ... } shape. The possible variants are:

sourceTypeDescriptionAdditional fields
"static"A directly set valuevalue
"prop"Bound to a component proppropId, propName
"cms"Bound to a CMS collection fieldcollectionId, collectionName, fieldId, fieldName, fieldType
"locale"Bound to a field on the current localefieldKey, fieldName
"localeItem"Bound to a field on a locale list itemfieldKey, fieldName
"page"Bound to a field on the current pagefieldKey, fieldName
"conditional"Unsupported conditional binding(none)
"legacy"Unsupported legacy binding(none)

Example

1// Find a component instance on the page
2const elements = await webflow.getAllElements();
3const instanceEl = elements.find(el => el.type === 'ComponentInstance');
4
5if (instanceEl?.type === 'ComponentInstance') {
6 // Get all props on the instance
7 const props = await instanceEl.searchProps();
8 console.log(props);
9 // [
10 // {
11 // propId: 'prop_1',
12 // valueType: 'textContent',
13 // bindableTo: ['string', 'textContent'],
14 // hasOverride: true,
15 // value: { sourceType: 'static', value: 'My Custom Title' },
16 // resolvedValue: 'My Custom Title',
17 // defaultValue: 'Welcome to our site',
18 // display: { label: 'Heading', group: 'Content' }
19 // },
20 // {
21 // propId: 'prop_3',
22 // valueType: 'textContent',
23 // bindableTo: ['string', 'textContent'],
24 // hasOverride: false,
25 // value: {
26 // sourceType: 'cms',
27 // collectionId: 'col_abc123',
28 // collectionName: 'Blog Posts',
29 // fieldId: 'field_author',
30 // fieldName: 'Author Name',
31 // fieldType: 'plainText'
32 // },
33 // resolvedValue: 'Jane Doe',
34 // defaultValue: '',
35 // display: { label: 'Author', group: 'Content' }
36 // },
37 // {
38 // propId: 'prop_4',
39 // valueType: 'boolean',
40 // bindableTo: ['boolean', 'string'],
41 // hasOverride: false,
42 // value: { sourceType: 'static', value: true },
43 // resolvedValue: true,
44 // defaultValue: true,
45 // display: { label: 'Show CTA', group: 'Settings', trueLabel: 'Visible', falseLabel: 'Hidden' }
46 // }
47 // ]
48
49 // Filter to only text props
50 const textProps = await instanceEl.searchProps({ valueType: 'textContent' });
51}

Error handling

ScenarioError tagMessage
Element is not a component instanceResourceMissingWithData"Element is not a component instance: <id>"
Invalid valueType filterInvalidRequest"Invalid valueType: <valueType>"
Insufficient permissionsForbidden"Insufficient permissions to access element"

Designer ability

Checks for authorization only

Designer abilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny