User changes pseudo mode of Designer

webflow.subscribe("pseudomode", callback)

Use this method to start listening for when a user changes the pseudo-state of the Designer.

Syntax

1webflow.subscribe(event: "pseudomode", callback: (pseudoState: PseudoStateKey) => void): Unsubscribe;
Pseudo-StateDesigner StateDescription
hoverHoverElement is hovered over by the mouse
pressedPressedElement is in pressed state
visitedVisitedLink element has been visited
focusFocusedElement has keyboard/input focus
focus-visibleFocused (Keyboard)Element has keyboard focus with visible indicator
focus-withinElement or its descendant has focus
placeholderPlaceholderPlaceholder text in form block inputs
first-childFirst ItemFirst Collection Item in a collection list
last-childLast ItemLast Collection Item in a collection list
nth-child(odd)Odd ItemsOdd-numbered Collection Item in a collection list
nth-child(even)Even ItemsEven-numbered Collection Item in a collection list

Parameters

  • event: "pseudomode" - The event to listen for.
  • callback: (pseudoState: PseudoStateKey) => void - The callback function to execute when the event occurs. The pseudoState parameter is the new pseudo-state of the Designer.

Returns

Return Value

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.

Example

1// Subscribe to changes in the pseudo state
2const pseudoStateCallback = (pseudoState: PseudoStateKey) => {
3 console.log('Pseudo State:', pseudoState);
4}
5
6const unsubscribePseudoState = webflow.subscribe('pseudomode', pseudoStateCallback);

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Built with