---
title: VisualViewport.width
slug: Web/API/VisualViewport/width
tags:
  - API
  - Property
  - Reference
  - Visual Viewport API
  - VisualViewport
  - viewport
  - width
browser-compat: api.VisualViewport.width
---
{{APIRef("Visual Viewport")}}

The **`width`** read-only property of the
{{domxref("VisualViewport")}} interface returns the width of the visual viewport, in CSS
pixels.

## Syntax

```js
var width = VisualViewport.width
```

### Value

A double.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}
