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
| Field | Type | Meaning |
|---|---|---|
currentSceneName | string | The active Unity scene name |
viewportWidth | number | Current UI viewport width in CSS pixels |
viewportHeight | number | Current UI viewport height in CSS pixels |
devicePixelRatio | number | Current device pixel ratio |
bridgeReady | boolean | Whether 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.