Reset All Props (Beta)

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.

Beta

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

Syntax

element.resetAllProps(): Promise<null>

Returns

Promise<null>

A Promise that resolves to null

Example

// Get all elements on the page
const elements = await webflow.getAllElements()
const instanceEl = elements.find(el => el.type === 'ComponentInstance')
if (instanceEl?.type === 'ComponentInstance') {
// Confirm that some props have overrides
const before = await instanceEl.getProps()
console.log(before[0].hasOverride) // true
// Reset all props to their component defaults
await instanceEl.resetAllProps()
// All props now reflect their component defaults
const after = await instanceEl.getProps()
console.log(after[0].hasOverride) // false
} else {
console.log('No component instance found')
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canEditAnyAnyCanvasAny