interface Viewport
Interface definition for an object that contains information about the user’s viewport, i.e. screen or window.
interface Viewport;
Description
A viewport object is available on the global application context, as app.viewport. Properties of this instance can be bound from views, to create a responsive UI, using the bindings from the UI.viewport object.
Examples
// Determine the viewport size directly:
if (app.viewport?.portrait) {
// ...do something specific here
}
Instance members
width
The viewport width in logical pixel units.height
The viewport height in logical pixel units.portrait
True if the viewport is taller than it is wide.cols
The number of columns in the viewport grid.rows
The number of rows in the viewport grid.prefersDark
True if the user’s preferences indicate a dark color scheme.
