User changes breakpoint
subscribe("mediaquery", callback)
Use this method to start listening for specific events in your App. In this case, we’re listening for when a user selects a different media query, also known as a breakpoint, in the Designer.
Webflow’s built-in responsive breakpoints 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
Parameters
event
: "mediaQuery"
The name of the event to subscribe to.
callback: (breakpoint: BreakpointId) => void
This is the function that will be called each time the event occurs. It takes a breakpoint
as a parameter. Use this function to define what should happen when the event is triggered.
Returns
Unsubscribe
This is a special function you receive after subscribing. When you no longer want to listen to the event, call this function to stop receiving notifications.