Viewport Debugger

A comprehensive debugging tool to help you understand and debug viewport behavior, especially useful for mobile web development and responsive design testing.

How to Use

Real-time Monitoring

The viewport debugger automatically updates metrics when major changes are detected every 100ms.

Testing Input Behavior

  1. Select an input type from the radio buttons
  2. Tap/click the input field to focus it
  3. On mobile devices, observe how the on-screen keyboard affects:
    • Window dimensions
    • Visual Viewport dimensions
    • Available screen space
    • Safe area insets

Use Cases

Mobile Development

Responsive Design

Bug Investigation

Performance Optimization

Technical Notes

Visual Viewport vs Layout Viewport

When a mobile keyboard appears, the visual viewport shrinks but the layout viewport stays the same. This tool shows both so you can understand the difference.

Safe Area Insets

Safe area insets are CSS environment variables introduced for devices with non-rectangular displays:

css
padding-top: env(safe-area-inset-top);
padding-right: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
padding-left: env(safe-area-inset-left);

Use the safe area values from this tool to ensure your UI is properly positioned.

Learn More

References