Skip to content

Interface: ViewportOptions ​

Experimental

Properties ​

PropertyTypeDescription
background?RGBA | nullExperimental Background fill for rect (sRGB 0–1). Omit/null to draw over what is below.
clearDepth?booleanExperimental Clear depth before drawing. Defaults to true for 3D viewports, false for 2D.
clip?boolean | ViewportRectExperimental Clipping. true (default): content is clipped to rect. false: no clipping (content may draw anywhere on the canvas, e.g. cliponaxis: false). A rect: clip to that rect (container coordinates, top-left origin) instead of rect.
far?numberExperimental
fit?booleanExperimental Track the full canvas size (used by the overlay viewport).
fov?numberExperimental 3D perspective vertical field of view in degrees. Default 45.
kind?ViewportKindExperimental Default '2d'.
name?stringExperimental Debug label.
near?numberExperimental Camera near/far. Defaults: 2D ±10000, 3D 0.01..1000.
order?numberExperimental Draw order; lower draws first. Ties keep insertion order. Default 0.
orthoHalfHeight?numberExperimental 3D orthographic: half of the visible height in world units. Default 1.
projection?"perspective" | "orthographic"Experimental 3D only. Default 'perspective'.
rect?ViewportRectExperimental Rect in CSS px (top-left origin of the container). Required unless fit is true.

Released under the MIT License.