> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# updateViewport

APISummary
The client updates the `LynxView` view size.

## Syntax

### Harmony

```typescript
public updateViewport(width: number, widthMode: number, height: number, heightMode: number): void;
```

#### Parameters

- `width`: Current `LynxView` width.
- `widthMode`: The measure mode for width. 0: Indefinite, 1: Definite, 2: AtMost.
- `height`: Current `LynxView` height.
- `heightMode`: The measure mode for height. 0: Indefinite, 1: Definite, 2: AtMost.

## Compatibility

**Compatibility Table**

**Query:** `lynx-native-api.lynx-context.update-viewport`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-context/update-viewport.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| update-viewport | Yes (2.1) | Yes (3.4) | Yes (2.1) | No | No | No |

**`update-viewport`**

update viewport of lynxView

**Specifications:**

