Download and install the asset into your OutSystems environment from Forge.
In the module where viewport size is required, consume the GetViewportSize web block from the component.
Drag and drop the GetViewportSize block where viewport size is needed.
The block exposes an Event named ViewportSizeOnChange.
This event provides the following parameters:
Width: Current browser viewport width
Height: Current browser viewport height
The event is automatically triggered whenever the viewport size changes due to browser resizing, zoom level changes, or device orientation changes, allowing the UI to adapt dynamically.