loomgui.com ↗

Built-in Loom state

Every bridge includes a small loom state object maintained by Loom. You do not declare it yourself.

const bridge = useBridge();

bridge.loom.currentSceneName;
bridge.loom.viewportWidth;
bridge.loom.viewportHeight;
bridge.loom.devicePixelRatio;
bridge.loom.bridgeReady;

Fields

FieldTypeMeaning
currentSceneNamestringThe active Unity scene name
viewportWidthnumberCurrent UI viewport width in CSS pixels
viewportHeightnumberCurrent UI viewport height in CSS pixels
devicePixelRationumberCurrent device pixel ratio
bridgeReadybooleanWhether the bridge has completed startup

Usage

Use built-in state for responsive UI and connection-aware screens:

const bridge = useBridge();

const compact = () => bridge.loom.viewportWidth < 900;

Ownership

The loom object is read-only from the UI. Loom updates it as the Unity scene, viewport, DPI, and connection state change.