Reset All Props

element.resetAllProps()

Reset all prop values on a component instance to their component defaults.

This method removes all static value overrides and bindings so that every prop returns the value that is defined in the component definition. This method is a no-op if the instance has no overrides, and resolves without error in that case. The reset is undoable via the Designer’s undo stack.

Syntax

1element.resetAllProps(): Promise<null>

Returns

Promise<null>

A Promise that resolves to null

Example

1// Get all elements on the page
2const elements = await webflow.getAllElements()
3const instanceEl = elements.find(el => el.type === 'ComponentInstance')
4
5if (instanceEl?.type === 'ComponentInstance') {
6
7 // Confirm that some props have overrides
8 const before = await instanceEl.getProps()
9 console.log(before[0].hasOverride) // true
10
11 // Reset all props to their component defaults
12 await instanceEl.resetAllProps()
13
14 // All props now reflect their component defaults
15 const after = await instanceEl.getProps()
16 console.log(after[0].hasOverride) // false
17
18} else {
19 console.log('No component instance found')
20}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canEditAnyAnyCanvasAny