---
title: "ctx.viewportSize"
description: "The frame size in device pixels, as a `vec2f`."
group: "define"
groupTitle: "Defining a shader"
categoryId: "invoke"
categorySlug: "invoke"
categoryTitle: "Context & invocation"
kind: "constant"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/invoke.ts#L54"
---

# ctx.viewportSize

The frame size in device pixels, as a `vec2f`.

```ts
ctx.viewportSize: CtxToken
```

Import `ctx` from `shaders/std` and use `ctx.viewportSize`.