Remove variable mode

mode.remove()

Remove a variable mode from a collection

Syntax

1mode.remove(): Promise<boolean>

Returns

Promise<boolean>

A Promise that resolves to boolean.

Example

1// Get Collection
2const collection = await webflow.getDefaultVariableCollection()
3
4// Get Variable Mode
5const variableMode = await collection?.getVariableModeByName(modeName)
6
7// Remove Variable Mode
8variableMode?.remove()

The base mode can’t be removed. Calling remove() on a collection’s base mode rejects with a VariableModeInvalid error, so guard against it when removing modes programmatically.

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign