> ## Documentation Index
> Fetch the complete documentation index at: https://docs.driver.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Window Size

> Configure browser viewport dimensions

Set custom browser window dimensions for your sessions.

## Setting Window Size

Specify dimensions as `WIDTHxHEIGHT`:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await client.browser.session.create({
    type: "hosted",
    windowSize: "1920x1080",
  });
  ```

  ```python Python theme={null}
  resp = requests.post(
      "https://api.driver.dev/v1/browser/session",
      headers={
          "Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
          "Content-Type": "application/json",
      },
      json={"type": "hosted", "windowSize": "1920x1080"}
  )
  resp.raise_for_status()
  session = resp.json()
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.driver.dev/v1/browser/session \
    -H "Authorization: Bearer $DRIVER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"type":"hosted","windowSize":"1920x1080"}'
  ```
</CodeGroup>

## Common Resolutions

| Resolution  | Aspect Ratio | Use Case        |
| ----------- | ------------ | --------------- |
| `1920x1080` | 16:9         | Desktop Full HD |
| `1366x768`  | 16:9         | Common laptop   |
| `1536x864`  | 16:9         | Scaled laptop   |
| `1440x900`  | 16:10        | MacBook         |
| `1280x720`  | 16:9         | HD              |
| `390x844`   | \~9:19.5     | iPhone 14       |
| `360x800`   | 9:20         | Android mobile  |

## Dynamic Resizing

You can also resize the viewport after connecting:

<CodeGroup>
  ```typescript Playwright (TypeScript) theme={null}
  await page.setViewportSize({ width: 1920, height: 1080 });
  ```

  ```typescript Puppeteer (TypeScript) theme={null}
  await page.setViewport({ width: 1920, height: 1080 });
  ```

  ```python Playwright (Python) theme={null}
  page.set_viewport_size({"width": 1920, "height": 1080})
  ```
</CodeGroup>

## Notes

* Window size affects the initial browser window dimensions
* Some sites detect and respond to viewport size
* For responsive testing, combine with framework viewport controls
* Default size varies by node if not specified
