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.getMediaQuery()
  • Syntax
  • Returns
  • Example
UtilitiesSite Information & Settings

Get the current breakpoint

Was this page helpful?
Previous

Get user ID token

Next
Built with

webflow.getMediaQuery()

Retrieves the current breakpoint setting in the Designer. Webflow’s built-in responsive breakpoints - also known as media queries - allow users to customize site designs for different screen sizes. Knowing the current breakpoint can help your app build responsive content that’s applicable to different screen sizes and contexts.

Syntax

1webflow.getMediaQuery(): Promise<BreakpointId>

Returns

Promise<BreakpointID >:"xxl" | "xl" | "large" | "main" | "medium" | "small" | "tiny" - Identifier for the breakpoint size, also known as media query, in the designer.

A Promise that resolves to the value of the Breakpoint ID.

Example

1const breakpointId = await webflow.getMediaQuery();
2
3 switch (breakpointId) {
4 case 'xxl':
5 console.log("The current view is for very large screens or high-resolution monitors.");
6 break;
7 case 'xl':
8 console.log("The current view is suitable for large desktop monitors.");
9 break;
10 case 'large':
11 console.log("The current view fits standard desktop monitors.");
12 break;
13 case 'main':
14 console.log("The current view is suitable for smaller desktops or large tablets.");
15 break;
16 case 'medium':
17 console.log("The current view is suitable for tablets and some large phones.");
18 break;
19 case 'small':
20 console.log("The current view is designed for larger mobile devices.");
21 break;
22 case 'tiny':
23 console.log("The current view is for the smallest mobile devices.");
24 break;
25 }
26}

Try this example