// The viewport width in CSS px — what a layout sizing itself to the screen should use
ctx.width(): numberThe viewport width in CSS px — what a layout sizing itself to the screen should use. Headless instances report the configured headless width, so a layout still works without a DOM.
Returns
numberthe viewport width
Example
// Inside a custom layout, ctx is supplied by the library.cy.layout({ impl: { run(ctx) { console.log(ctx.width()); // 800} } }).run();