Returns information about the active page. A page is considered active if it takes up the majority of the viewport or if the user has explicitly selected it.
Usage
import { getDesignInteraction } from "@canva/design-interaction";(async () => {const designInteraction = getDesignInteraction();const context = await designInteraction.getCurrentPageContext();console.log(context);})();
Returns
A Promise
that resolves with a result
object:
Required
Information about the active page.
Optional
The dimensions of the page, in pixels.
Some types of designs, such as whiteboards and documents, don't have page dimensions. In these cases, the dimensions
property is undefined
.
Required
The width of the page, in pixels.
Required
The height of the page, in pixels.