For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
        • Get all variable modes
        • Get variable mode by name
        • Get variable mode by ID
        • Create variable mode
        • Remove variable mode
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • collection.createVariableMode(name)
Variables & CollectionsVariable ModesCreating & Retrieving Variable Modes

Create variable mode

Was this page helpful?
Previous

Remove variable mode

Next
Built with

collection.createVariableMode(name)

Create a variable mode in a collection. Variable modes created with the Designer API are always created as “Manual” modes.

Syntax

1collection.createVariableMode(name: string): Promise<VariableMode>

Parameters

  • name: string - The name of the variable mode to create.

Returns

Promise<VariableMode>

A Promise that resolves to a VariableMode object.

Example

1// Get Collection
2const collection = await webflow.getDefaultVariableCollection()
3
4// Create Variable Mode
5const variableMode = await collection?.createVariableMode("Dark Mode")
6console.log(variableMode)

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign