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
  • Assets
  • Pages & Folders
  • Utilities
      • Get site information
      • Resize the extension
      • Close the extension
      • Get the current breakpoint
      • Get user ID token
      • Get user's Designer capabilities
      • Get the current Designer mode
      • Check for a Designer mode
      • Get the Designer's pseudo-state
      • Get launch context
      • Get app subscriptions
      • Get theme
      • Get theme styles
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • webflow.getCurrentMode()
  • Syntax
  • Returns
  • Example
  • Example: Adapting the UI based on mode
UtilitiesSite Information & Settings

Get the current Designer mode

Was this page helpful?
Previous

Check for a Designer mode

Next
Built with

webflow.getCurrentMode()

Returns the name of the Designer mode that the user is currently in.

Use this method to read the active mode on demand, such as when your extension launches or before an action runs. To react to mode changes as they happen, use webflow.subscribe("currentappmode", callback). To check whether the Designer is in one specific mode, use webflow.isMode().

Syntax

1webflow.getCurrentMode(): Promise<AppModeName | null>

Returns

Promise<AppModeName | null>

A Promise that resolves to the current mode name as a string, or null when the Designer’s internal state does not map to a public mode.

The Designer exposes five public modes:

ModeNameDescription
Design"design"Editing layout and styling
Build"build"CMS content editing on the canvas
Preview"preview"Read-only site preview
Edit"edit"Editor context outside the canvas
Comment"comment"Annotation and commenting

Example

1const mode = await webflow.getCurrentMode();
2
3if (mode === "design") {
4 console.log("The user is in Design mode.");
5} else if (mode === null) {
6 console.log("The Designer is not in a public mode.");
7} else {
8 console.log(`The user is in ${mode} mode.`);
9}

Try this example

Example: Adapting the UI based on mode

Read the current mode when your extension launches and render the matching UI:

1async function renderForCurrentMode() {
2 const mode = await webflow.getCurrentMode();
3
4 switch (mode) {
5 case "design":
6 await renderDesignTools();
7 break;
8 case "build":
9 await renderContentEditingTools();
10 break;
11 case "preview":
12 case "edit":
13 case "comment":
14 await renderReadOnlyState();
15 break;
16 default:
17 await webflow.notify({
18 type: "Info",
19 message: "The Designer is not in a public mode.",
20 });
21 }
22}
23
24await renderForCurrentMode();

Try this example