← React Viewport

Live Geometry Lab

This lab is not trying to beat CSS layout. It shows the browser geometry React Viewport exposes to application logic.

Looking for keyboard-safe layout? See the CSS baseline →

  1. Focus the input and open the software keyboard.
  2. Watch geometry and the result budget. Scroll to change browser chrome.
  3. Place a target, then scroll, rotate or pinch zoom where supported.
  4. Close the keyboard and compare values.

Browser policy: interactive-widget=resizes-content. Requested, not detected. When both viewports shrink, keyboard bottom occlusion can stay zero. iOS may ignore the request.

What does this browser expose?

Measuring…
layout.width
Pending
layout.height
Pending
visual.width
Pending
visual.height
Pending
visual.offsetTop
Pending
visual.offsetLeft
Pending
visual.pageTop
Pending
visual.pageLeft
Pending
visual.scale
Pending
keyboard.open
Pending
keyboard.height (bottom occlusion)
Pending
safeArea.top
Pending
safeArea.right
Pending
safeArea.bottom
Pending
safeArea.left
Pending
Orientation
Pending
VisualViewport API
Pending
VirtualKeyboard API
Pending

Raw geometry from the current browser. API presence does not identify the active keyboard source. No simulation.

Application decision

Normal CSS layout. Typed text is never sent, saved or included in diagnostics.

Measuring viewport…

Example policy: reserve 320px for search controls, allow 48px per row, cap at 8. This is a viewport-derived budget, not a measurement of this card.

CSS can resize a container. This JavaScript decision changes which optional results React creates. The constants are application policy, not library defaults.

Is this point actually visible?

Target visible? Place a target

A selected 20 × 20 document-coordinate target. Place it near the visible bottom, then open the keyboard, scroll or zoom. Its document coordinates stay fixed.

Keep the target selected while the actual keyboard changes the viewport. This field is not stored or sent.

Keyboard-aware scroll correction

The application recalculates a vertical scroll correction when viewport geometry changes. CSS cannot call a selection algorithm. Try the default observation first; opt in only to test correction.

Suggested vertical correction: Pending

Correction runs after selection, viewport-size, scale or keyboard-state changes, not ordinary scrolling. Opt-in page scrolling can be clamped at document boundaries. It does not manage focus, defeat native browser panning, or guarantee visibility inside nested scrollers.

Zoom-aware application logic

Optional annotation hit tolerance: Pending

A canvas tool can convert a 12 CSS-pixel tolerance at unit scale using 12 / visual.scale. This is an algorithm input, not a smaller button or text size.

Pinch zoom is user viewport geometry, not responsive design. Essential controls remain available at every scale.

Safe-area input for a custom drawing surface: Pending.

Use these raw protected-edge values only after mapping the drawing surface into the same coordinate system. For ordinary padding, use env() directly.

Reading unexpected results

Compare visual dimensions, offsets and scale before interpreting keyboard state. Browser chrome and zoom can change geometry without an open keyboard. Keyboard state is native where usable and otherwise conservatively inferred.

A real keyboard with zero bottom occlusion can reflect native layout resizing, a floating or split keyboard, or conservative inference. Capture before/during/after geometry to investigate. Safe-area values may remain non-zero on WebKit.

Browser updates can lag during fast scrolling. No layout workaround here changes the raw values or claims to fix that platform behavior. Physical iPhone Safari and Android Chrome geometry QA remains pending.

Expected: dimensions and offsets follow browser changes; result count follows visible height; target intersection follows the selected document coordinates. These are manual checks, not automatic pass badges.

DeviceLab.tsx · actual source
LiveGeometry.tsx · actual source
ResultBudget.tsx · actual source
CoordinateVisibility.tsx · actual source
geometry-logic.ts · actual source
ZoomLogic.tsx · actual source