> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Create variable mode

> Learn how to create a variable mode.

## `collection.createVariableMode(name, breakpointId)`

Create a variable mode in a collection.

Variable modes can be created as one of two types:

* **Manual modes** are applied manually to elements or pages. Omit the `breakpointId` parameter, or pass `null`, to create a manual mode.
* **Automatic modes** are driven by a [breakpoint](https://help.webflow.com/hc/en-us/articles/33961300305811) and apply automatically at the matching screen size. Pass a `BreakpointId` to create an automatic mode.

#

### Syntax

```typescript
collection.createVariableMode(name: string, breakpointId?: BreakpointId | null): Promise<VariableMode>
```

### Parameters

* **name**: *string* - The name of the variable mode to create.
* **breakpointId**: *BreakpointId | null* (optional) - The breakpoint that drives the mode automatically: `"xxl" | "xl" | "large" | "main" | "medium" | "small" | "tiny"`. Omit or pass `null` to create a manual mode.

### Returns

**Promise\<*VariableMode*>**

A Promise that resolves to a VariableMode object.

#

### Example

```typescript
// Get Collection
const collection = await webflow.getDefaultVariableCollection()

// Create a manual variable mode
const darkMode = await collection?.createVariableMode("Dark Mode")
console.log(darkMode)

// Create an automatic variable mode driven by the tablet breakpoint
const tabletMode = await collection?.createVariableMode("Tablet", "medium")
console.log(tabletMode)
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

> **Note**
>
> Each breakpoint can drive only one automatic mode per collection, including the implicit base mode. The breakpoint must also be enabled on the site. Binding to a breakpoint that's already in use, not enabled, or invalid rejects with a `VariableModeInvalid` error. See [Set variable mode breakpoint](/designer/reference/set-variable-mode-breakpoint) for details on handling these errors.

### Designer Ability

| Designer Ability       | Locale | Branch | Workflow | Sitemode |
| :--------------------- | :----- | :----- | :------- | :------- |
| **canModifyVariables** | Any    | Main   | Canvas   | Design   |