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
        • Set variable value
        • Get variable value
        • Get variable name
        • Set variable name
        • Get variable binding
        • Get variable CSS name
        • Remove variable
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • variable.getBinding()
  • Syntax
  • Returns
  • Example
  • Designer Ability
Variables & CollectionsVariablesManaging Variables

Get variable binding

Was this page helpful?
Previous

Get CSS name

Next
Built with

variable.getBinding()

Returns a binding value for the variable. Use the binding value when creating or updating variables with custom values.

Syntax

1variable.getBinding(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string representing the variable’s binding.

Example

1// Create a variable
2const webflowBlue = await collection?.createColorVariable(
3 "blue-500",
4 "#146EF5"
5);
6
7// Get the binding value for a variable
8const binding = await webflowBlue.getBinding();
9// binding = "var(--blue-500)"
10
11// Use the binding value to create a variable with a custom value
12const webflowBlue400 = await collection.createColorVariable("blue-400", {
13 type: "custom",
14 value: `color-mix(in srgb, ${binding}, white 50%)`,
15});

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadVariablesAnyAnyAnyAny