Viewport
Viewport(
__namedParameters):ReactElement
Defined in: src/components/primitives/viewport/Viewport.tsx:103
Viewport — 2D only. A pan/zoom canvas + HTML container for editor-style
surfaces such as node graphs, timelines, and 2D world editors. Despite the
name it is not a 3D viewport: it owns a 2D pan/zoom transform, not a camera.
For 3D, host your own WebGL/WebGPU canvas (e.g. inside an AppShell.Dock) and
reach for Viewport only for 2D editor surfaces.
Composes:
- Multiple perf-isolated
<ViewportLayer>canvases (one draw cycle each). <ViewportWorld>for HTML positioned in world coordinates.<ViewportOverlay>for HTML pinned to the viewport (toolbars, minimap).
Owns pan/zoom gestures (drag-to-pan, wheel-zoom-toward-cursor, optional
pinch and space-to-pan) and optional marquee selection. Transform is
controlled or uncontrolled (useControlledState-style) and mirrored
into an internal ViewportStore that powers slice-level subscriptions
for layers, world, and overlay children.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”about?
Section titled “about?”string
accessKey?
Section titled “accessKey?”string
aria-activedescendant?
Section titled “aria-activedescendant?”string
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
aria-atomic?
Section titled “aria-atomic?”Booleanish
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
aria-autocomplete?
Section titled “aria-autocomplete?”"none" | "inline" | "both" | "list"
Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.
aria-braillelabel?
Section titled “aria-braillelabel?”string
Defines a string value that labels the current element, which is intended to be converted into Braille.
See
aria-label.
aria-brailleroledescription?
Section titled “aria-brailleroledescription?”string
Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
See
aria-roledescription.
aria-busy?
Section titled “aria-busy?”Booleanish
aria-checked?
Section titled “aria-checked?”boolean | "mixed" | "false" | "true"
Indicates the current “checked” state of checkboxes, radio buttons, and other widgets.
See
- aria-pressed
- aria-selected.
aria-colcount?
Section titled “aria-colcount?”number
Defines the total number of columns in a table, grid, or treegrid.
See
aria-colindex.
aria-colindex?
Section titled “aria-colindex?”number
Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid.
See
- aria-colcount
- aria-colspan.
aria-colindextext?
Section titled “aria-colindextext?”string
Defines a human readable text alternative of aria-colindex.
See
aria-rowindextext.
aria-colspan?
Section titled “aria-colspan?”number
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
See
- aria-colindex
- aria-rowspan.
aria-controls?
Section titled “aria-controls?”string
Identifies the element (or elements) whose contents or presence are controlled by the current element.
See
aria-owns.
aria-current?
Section titled “aria-current?”boolean | "location" | "page" | "false" | "true" | "step" | "date" | "time"
Indicates the element that represents the current item within a container or set of related elements.
aria-describedby?
Section titled “aria-describedby?”string
Identifies the element (or elements) that describes the object.
See
aria-labelledby
aria-description?
Section titled “aria-description?”string
Defines a string value that describes or annotates the current element.
See
related aria-describedby.
aria-details?
Section titled “aria-details?”string
Identifies the element that provides a detailed, extended description for the object.
See
aria-describedby.
aria-disabled?
Section titled “aria-disabled?”Booleanish
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
See
- aria-hidden
- aria-readonly.
aria-dropeffect?
Section titled “aria-dropeffect?”"none" | "link" | "copy" | "move" | "execute" | "popup"
Indicates what functions can be performed when a dragged object is released on the drop target.
aria-errormessage?
Section titled “aria-errormessage?”string
Identifies the element that provides an error message for the object.
See
- aria-invalid
- aria-describedby.
aria-expanded?
Section titled “aria-expanded?”Booleanish
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
aria-flowto?
Section titled “aria-flowto?”string
Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.
aria-grabbed?
Section titled “aria-grabbed?”Booleanish
Indicates an element’s “grabbed” state in a drag-and-drop operation.
aria-haspopup?
Section titled “aria-haspopup?”boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree"
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
aria-hidden?
Section titled “aria-hidden?”Booleanish
Indicates whether the element is exposed to an accessibility API.
See
aria-disabled.
aria-invalid?
Section titled “aria-invalid?”boolean | "false" | "true" | "grammar" | "spelling"
Indicates the entered value does not conform to the format expected by the application.
See
aria-errormessage.
aria-keyshortcuts?
Section titled “aria-keyshortcuts?”string
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
aria-label?
Section titled “aria-label?”string
Defines a string value that labels the current element.
See
aria-labelledby.
aria-labelledby?
Section titled “aria-labelledby?”string
Identifies the element (or elements) that labels the current element.
See
aria-describedby.
aria-level?
Section titled “aria-level?”number
Defines the hierarchical level of an element within a structure.
aria-live?
Section titled “aria-live?”"off" | "assertive" | "polite"
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
aria-modal?
Section titled “aria-modal?”Booleanish
Indicates whether an element is modal when displayed.
aria-multiline?
Section titled “aria-multiline?”Booleanish
Indicates whether a text box accepts multiple lines of input or only a single line.
aria-multiselectable?
Section titled “aria-multiselectable?”Booleanish
Indicates that the user may select more than one item from the current selectable descendants.
aria-orientation?
Section titled “aria-orientation?”"horizontal" | "vertical"
Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.
aria-owns?
Section titled “aria-owns?”string
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
See
aria-controls.
aria-placeholder?
Section titled “aria-placeholder?”string
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
aria-posinset?
Section titled “aria-posinset?”number
Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
See
aria-setsize.
aria-pressed?
Section titled “aria-pressed?”boolean | "mixed" | "false" | "true"
Indicates the current “pressed” state of toggle buttons.
See
- aria-checked
- aria-selected.
aria-readonly?
Section titled “aria-readonly?”Booleanish
Indicates that the element is not editable, but is otherwise operable.
See
aria-disabled.
aria-relevant?
Section titled “aria-relevant?”"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
See
aria-atomic.
aria-required?
Section titled “aria-required?”Booleanish
Indicates that user input is required on the element before a form may be submitted.
aria-roledescription?
Section titled “aria-roledescription?”string
Defines a human-readable, author-localized description for the role of an element.
aria-rowcount?
Section titled “aria-rowcount?”number
Defines the total number of rows in a table, grid, or treegrid.
See
aria-rowindex.
aria-rowindex?
Section titled “aria-rowindex?”number
Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.
See
- aria-rowcount
- aria-rowspan.
aria-rowindextext?
Section titled “aria-rowindextext?”string
Defines a human readable text alternative of aria-rowindex.
See
aria-colindextext.
aria-rowspan?
Section titled “aria-rowspan?”number
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
See
- aria-rowindex
- aria-colspan.
aria-selected?
Section titled “aria-selected?”Booleanish
Indicates the current “selected” state of various widgets.
See
- aria-checked
- aria-pressed.
aria-setsize?
Section titled “aria-setsize?”number
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
See
aria-posinset.
aria-sort?
Section titled “aria-sort?”"none" | "ascending" | "descending" | "other"
Indicates if items in a table or grid are sorted in ascending or descending order.
aria-valuemax?
Section titled “aria-valuemax?”number
Defines the maximum allowed value for a range widget.
aria-valuemin?
Section titled “aria-valuemin?”number
Defines the minimum allowed value for a range widget.
aria-valuenow?
Section titled “aria-valuenow?”number
Defines the current value for a range widget.
See
aria-valuetext.
aria-valuetext?
Section titled “aria-valuetext?”string
Defines the human readable text alternative of aria-valuenow for a range widget.
ariaLabel?
Section titled “ariaLabel?”string
ariaRoledescription?
Section titled “ariaRoledescription?”string
autoCapitalize?
Section titled “autoCapitalize?”"none" | string & object | "off" | "on" | "sentences" | "words" | "characters"
autoCorrect?
Section titled “autoCorrect?”string
autoFocus?
Section titled “autoFocus?”boolean
autoSave?
Section titled “autoSave?”string
children?
Section titled “children?”ReactNode
Layers (<ViewportLayer>), world children (<ViewportWorld>),
and overlay children (<ViewportOverlay>).
className?
Section titled “className?”string
Additional CSS class names
color?
Section titled “color?”string
content?
Section titled “content?”string
contentEditable?
Section titled “contentEditable?”"inherit" | Booleanish | "plaintext-only"
contextMenu?
Section titled “contextMenu?”string
dangerouslySetInnerHTML?
Section titled “dangerouslySetInnerHTML?”{ __html: string | TrustedHTML; }
dangerouslySetInnerHTML.__html
Section titled “dangerouslySetInnerHTML.__html”string | TrustedHTML
datatype?
Section titled “datatype?”string
defaultChecked?
Section titled “defaultChecked?”boolean
defaultTransform?
Section titled “defaultTransform?”Default transform when uncontrolled.
Default
{ x: 0, y: 0, zoom: 1 }defaultValue?
Section titled “defaultValue?”string | number | readonly string[]
string
disabled?
Section titled “disabled?”boolean = false
Disable all interaction and dim the viewport.
Default
falsedraggable?
Section titled “draggable?”Booleanish
enterKeyHint?
Section titled “enterKeyHint?”"search" | "next" | "enter" | "done" | "go" | "previous" | "send"
exportparts?
Section titled “exportparts?”string
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
height?
Section titled “height?”number = 300
Fixed height in pixels (ignored when responsive is true).
Default
300hidden?
Section titled “hidden?”boolean
string
Unique identifier for the component
inert?
Section titled “inert?”boolean
See
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
inlist?
Section titled “inlist?”any
inputMode?
Section titled “inputMode?”"text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal"
Hints at the type of data that might be entered by the user while editing the element or its contents
See
https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
string
Specify that a standard HTML element should behave like a defined custom built-in element
See
https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
itemID?
Section titled “itemID?”string
itemProp?
Section titled “itemProp?”string
itemRef?
Section titled “itemRef?”string
itemScope?
Section titled “itemScope?”boolean
itemType?
Section titled “itemType?”string
string
maxZoom?
Section titled “maxZoom?”number = 8
Maximum zoom level.
Default
8minZoom?
Section titled “minZoom?”number = 0.1
Minimum zoom level.
Default
0.1nonce?
Section titled “nonce?”string
onAbort?
Section titled “onAbort?”ReactEventHandler<HTMLDivElement>
onAbortCapture?
Section titled “onAbortCapture?”ReactEventHandler<HTMLDivElement>
onAnimationEnd?
Section titled “onAnimationEnd?”AnimationEventHandler<HTMLDivElement>
onAnimationEndCapture?
Section titled “onAnimationEndCapture?”AnimationEventHandler<HTMLDivElement>
onAnimationIteration?
Section titled “onAnimationIteration?”AnimationEventHandler<HTMLDivElement>
onAnimationIterationCapture?
Section titled “onAnimationIterationCapture?”AnimationEventHandler<HTMLDivElement>
onAnimationStart?
Section titled “onAnimationStart?”AnimationEventHandler<HTMLDivElement>
onAnimationStartCapture?
Section titled “onAnimationStartCapture?”AnimationEventHandler<HTMLDivElement>
onAuxClick?
Section titled “onAuxClick?”MouseEventHandler<HTMLDivElement>
onAuxClickCapture?
Section titled “onAuxClickCapture?”MouseEventHandler<HTMLDivElement>
onBeforeInput?
Section titled “onBeforeInput?”InputEventHandler<HTMLDivElement>
onBeforeInputCapture?
Section titled “onBeforeInputCapture?”InputEventHandler<HTMLDivElement>
onBeforeToggle?
Section titled “onBeforeToggle?”ToggleEventHandler<HTMLDivElement>
onBlur?
Section titled “onBlur?”FocusEventHandler<HTMLDivElement>
onBlurCapture?
Section titled “onBlurCapture?”FocusEventHandler<HTMLDivElement>
onCanPlay?
Section titled “onCanPlay?”ReactEventHandler<HTMLDivElement>
onCanPlayCapture?
Section titled “onCanPlayCapture?”ReactEventHandler<HTMLDivElement>
onCanPlayThrough?
Section titled “onCanPlayThrough?”ReactEventHandler<HTMLDivElement>
onCanPlayThroughCapture?
Section titled “onCanPlayThroughCapture?”ReactEventHandler<HTMLDivElement>
onChangeCapture?
Section titled “onChangeCapture?”ChangeEventHandler<HTMLDivElement, Element>
onClick?
Section titled “onClick?”MouseEventHandler<HTMLDivElement>
onClickCapture?
Section titled “onClickCapture?”MouseEventHandler<HTMLDivElement>
onCompositionEnd?
Section titled “onCompositionEnd?”CompositionEventHandler<HTMLDivElement>
onCompositionEndCapture?
Section titled “onCompositionEndCapture?”CompositionEventHandler<HTMLDivElement>
onCompositionStart?
Section titled “onCompositionStart?”CompositionEventHandler<HTMLDivElement>
onCompositionStartCapture?
Section titled “onCompositionStartCapture?”CompositionEventHandler<HTMLDivElement>
onCompositionUpdate?
Section titled “onCompositionUpdate?”CompositionEventHandler<HTMLDivElement>
onCompositionUpdateCapture?
Section titled “onCompositionUpdateCapture?”CompositionEventHandler<HTMLDivElement>
onContextMenu?
Section titled “onContextMenu?”MouseEventHandler<HTMLDivElement>
onContextMenuCapture?
Section titled “onContextMenuCapture?”MouseEventHandler<HTMLDivElement>
onCopy?
Section titled “onCopy?”ClipboardEventHandler<HTMLDivElement>
onCopyCapture?
Section titled “onCopyCapture?”ClipboardEventHandler<HTMLDivElement>
onCut?
Section titled “onCut?”ClipboardEventHandler<HTMLDivElement>
onCutCapture?
Section titled “onCutCapture?”ClipboardEventHandler<HTMLDivElement>
onDoubleClick?
Section titled “onDoubleClick?”MouseEventHandler<HTMLDivElement>
onDoubleClickCapture?
Section titled “onDoubleClickCapture?”MouseEventHandler<HTMLDivElement>
onDrag?
Section titled “onDrag?”DragEventHandler<HTMLDivElement>
onDragCapture?
Section titled “onDragCapture?”DragEventHandler<HTMLDivElement>
onDragEnd?
Section titled “onDragEnd?”DragEventHandler<HTMLDivElement>
onDragEndCapture?
Section titled “onDragEndCapture?”DragEventHandler<HTMLDivElement>
onDragEnter?
Section titled “onDragEnter?”DragEventHandler<HTMLDivElement>
onDragEnterCapture?
Section titled “onDragEnterCapture?”DragEventHandler<HTMLDivElement>
onDragExit?
Section titled “onDragExit?”DragEventHandler<HTMLDivElement>
onDragExitCapture?
Section titled “onDragExitCapture?”DragEventHandler<HTMLDivElement>
onDragLeave?
Section titled “onDragLeave?”DragEventHandler<HTMLDivElement>
onDragLeaveCapture?
Section titled “onDragLeaveCapture?”DragEventHandler<HTMLDivElement>
onDragOver?
Section titled “onDragOver?”DragEventHandler<HTMLDivElement>
onDragOverCapture?
Section titled “onDragOverCapture?”DragEventHandler<HTMLDivElement>
onDragStart?
Section titled “onDragStart?”DragEventHandler<HTMLDivElement>
onDragStartCapture?
Section titled “onDragStartCapture?”DragEventHandler<HTMLDivElement>
onDrop?
Section titled “onDrop?”DragEventHandler<HTMLDivElement>
onDropCapture?
Section titled “onDropCapture?”DragEventHandler<HTMLDivElement>
onDurationChange?
Section titled “onDurationChange?”ReactEventHandler<HTMLDivElement>
onDurationChangeCapture?
Section titled “onDurationChangeCapture?”ReactEventHandler<HTMLDivElement>
onEmptied?
Section titled “onEmptied?”ReactEventHandler<HTMLDivElement>
onEmptiedCapture?
Section titled “onEmptiedCapture?”ReactEventHandler<HTMLDivElement>
onEncrypted?
Section titled “onEncrypted?”ReactEventHandler<HTMLDivElement>
onEncryptedCapture?
Section titled “onEncryptedCapture?”ReactEventHandler<HTMLDivElement>
onEnded?
Section titled “onEnded?”ReactEventHandler<HTMLDivElement>
onEndedCapture?
Section titled “onEndedCapture?”ReactEventHandler<HTMLDivElement>
onError?
Section titled “onError?”ReactEventHandler<HTMLDivElement>
onErrorCapture?
Section titled “onErrorCapture?”ReactEventHandler<HTMLDivElement>
onFocus?
Section titled “onFocus?”FocusEventHandler<HTMLDivElement>
onFocusCapture?
Section titled “onFocusCapture?”FocusEventHandler<HTMLDivElement>
onGotPointerCapture?
Section titled “onGotPointerCapture?”PointerEventHandler<HTMLDivElement>
onGotPointerCaptureCapture?
Section titled “onGotPointerCaptureCapture?”PointerEventHandler<HTMLDivElement>
onInput?
Section titled “onInput?”InputEventHandler<HTMLDivElement>
onInputCapture?
Section titled “onInputCapture?”InputEventHandler<HTMLDivElement>
onInvalid?
Section titled “onInvalid?”ReactEventHandler<HTMLDivElement>
onInvalidCapture?
Section titled “onInvalidCapture?”ReactEventHandler<HTMLDivElement>
onKeyDown?
Section titled “onKeyDown?”KeyboardEventHandler<HTMLDivElement>
onKeyDownCapture?
Section titled “onKeyDownCapture?”KeyboardEventHandler<HTMLDivElement>
onKeyPress?
Section titled “onKeyPress?”KeyboardEventHandler<HTMLDivElement>
onKeyPressCapture?
Section titled “onKeyPressCapture?”KeyboardEventHandler<HTMLDivElement>
onKeyUp?
Section titled “onKeyUp?”KeyboardEventHandler<HTMLDivElement>
onKeyUpCapture?
Section titled “onKeyUpCapture?”KeyboardEventHandler<HTMLDivElement>
onLoad?
Section titled “onLoad?”ReactEventHandler<HTMLDivElement>
onLoadCapture?
Section titled “onLoadCapture?”ReactEventHandler<HTMLDivElement>
onLoadedData?
Section titled “onLoadedData?”ReactEventHandler<HTMLDivElement>
onLoadedDataCapture?
Section titled “onLoadedDataCapture?”ReactEventHandler<HTMLDivElement>
onLoadedMetadata?
Section titled “onLoadedMetadata?”ReactEventHandler<HTMLDivElement>
onLoadedMetadataCapture?
Section titled “onLoadedMetadataCapture?”ReactEventHandler<HTMLDivElement>
onLoadStart?
Section titled “onLoadStart?”ReactEventHandler<HTMLDivElement>
onLoadStartCapture?
Section titled “onLoadStartCapture?”ReactEventHandler<HTMLDivElement>
onLostPointerCapture?
Section titled “onLostPointerCapture?”PointerEventHandler<HTMLDivElement>
onLostPointerCaptureCapture?
Section titled “onLostPointerCaptureCapture?”PointerEventHandler<HTMLDivElement>
onMouseDown?
Section titled “onMouseDown?”MouseEventHandler<HTMLDivElement>
onMouseDownCapture?
Section titled “onMouseDownCapture?”MouseEventHandler<HTMLDivElement>
onMouseEnter?
Section titled “onMouseEnter?”MouseEventHandler<HTMLDivElement>
onMouseLeave?
Section titled “onMouseLeave?”MouseEventHandler<HTMLDivElement>
onMouseMove?
Section titled “onMouseMove?”MouseEventHandler<HTMLDivElement>
onMouseMoveCapture?
Section titled “onMouseMoveCapture?”MouseEventHandler<HTMLDivElement>
onMouseOut?
Section titled “onMouseOut?”MouseEventHandler<HTMLDivElement>
onMouseOutCapture?
Section titled “onMouseOutCapture?”MouseEventHandler<HTMLDivElement>
onMouseOver?
Section titled “onMouseOver?”MouseEventHandler<HTMLDivElement>
onMouseOverCapture?
Section titled “onMouseOverCapture?”MouseEventHandler<HTMLDivElement>
onMouseUp?
Section titled “onMouseUp?”MouseEventHandler<HTMLDivElement>
onMouseUpCapture?
Section titled “onMouseUpCapture?”MouseEventHandler<HTMLDivElement>
onPanEnd?
Section titled “onPanEnd?”(info) => void
Called when a pan gesture ends. Includes velocity for inertia recipes.
onPanStart?
Section titled “onPanStart?”() => void
Called when a pan gesture starts.
onPaste?
Section titled “onPaste?”ClipboardEventHandler<HTMLDivElement>
onPasteCapture?
Section titled “onPasteCapture?”ClipboardEventHandler<HTMLDivElement>
onPause?
Section titled “onPause?”ReactEventHandler<HTMLDivElement>
onPauseCapture?
Section titled “onPauseCapture?”ReactEventHandler<HTMLDivElement>
onPlay?
Section titled “onPlay?”ReactEventHandler<HTMLDivElement>
onPlayCapture?
Section titled “onPlayCapture?”ReactEventHandler<HTMLDivElement>
onPlaying?
Section titled “onPlaying?”ReactEventHandler<HTMLDivElement>
onPlayingCapture?
Section titled “onPlayingCapture?”ReactEventHandler<HTMLDivElement>
onPointerCancel?
Section titled “onPointerCancel?”PointerEventHandler<HTMLDivElement>
onPointerCancelCapture?
Section titled “onPointerCancelCapture?”PointerEventHandler<HTMLDivElement>
onPointerDown?
Section titled “onPointerDown?”PointerEventHandler<HTMLDivElement>
onPointerDownCapture?
Section titled “onPointerDownCapture?”PointerEventHandler<HTMLDivElement>
onPointerEnter?
Section titled “onPointerEnter?”PointerEventHandler<HTMLDivElement>
onPointerLeave?
Section titled “onPointerLeave?”PointerEventHandler<HTMLDivElement>
onPointerMove?
Section titled “onPointerMove?”PointerEventHandler<HTMLDivElement>
onPointerMoveCapture?
Section titled “onPointerMoveCapture?”PointerEventHandler<HTMLDivElement>
onPointerOut?
Section titled “onPointerOut?”PointerEventHandler<HTMLDivElement>
onPointerOutCapture?
Section titled “onPointerOutCapture?”PointerEventHandler<HTMLDivElement>
onPointerOver?
Section titled “onPointerOver?”PointerEventHandler<HTMLDivElement>
onPointerOverCapture?
Section titled “onPointerOverCapture?”PointerEventHandler<HTMLDivElement>
onPointerUp?
Section titled “onPointerUp?”PointerEventHandler<HTMLDivElement>
onPointerUpCapture?
Section titled “onPointerUpCapture?”PointerEventHandler<HTMLDivElement>
onProgress?
Section titled “onProgress?”ReactEventHandler<HTMLDivElement>
onProgressCapture?
Section titled “onProgressCapture?”ReactEventHandler<HTMLDivElement>
onRateChange?
Section titled “onRateChange?”ReactEventHandler<HTMLDivElement>
onRateChangeCapture?
Section titled “onRateChangeCapture?”ReactEventHandler<HTMLDivElement>
onReset?
Section titled “onReset?”ReactEventHandler<HTMLDivElement>
onResetCapture?
Section titled “onResetCapture?”ReactEventHandler<HTMLDivElement>
onScroll?
Section titled “onScroll?”UIEventHandler<HTMLDivElement>
onScrollCapture?
Section titled “onScrollCapture?”UIEventHandler<HTMLDivElement>
onScrollEnd?
Section titled “onScrollEnd?”UIEventHandler<HTMLDivElement>
onScrollEndCapture?
Section titled “onScrollEndCapture?”UIEventHandler<HTMLDivElement>
onSeeked?
Section titled “onSeeked?”ReactEventHandler<HTMLDivElement>
onSeekedCapture?
Section titled “onSeekedCapture?”ReactEventHandler<HTMLDivElement>
onSeeking?
Section titled “onSeeking?”ReactEventHandler<HTMLDivElement>
onSeekingCapture?
Section titled “onSeekingCapture?”ReactEventHandler<HTMLDivElement>
onSelect?
Section titled “onSelect?”ReactEventHandler<HTMLDivElement>
onSelectCapture?
Section titled “onSelectCapture?”ReactEventHandler<HTMLDivElement>
onSelectionChange?
Section titled “onSelectionChange?”(info) => void
Called during marquee drag (intermediate + final).
onStalled?
Section titled “onStalled?”ReactEventHandler<HTMLDivElement>
onStalledCapture?
Section titled “onStalledCapture?”ReactEventHandler<HTMLDivElement>
onSubmit?
Section titled “onSubmit?”SubmitEventHandler<HTMLDivElement>
onSubmitCapture?
Section titled “onSubmitCapture?”SubmitEventHandler<HTMLDivElement>
onSuspend?
Section titled “onSuspend?”ReactEventHandler<HTMLDivElement>
onSuspendCapture?
Section titled “onSuspendCapture?”ReactEventHandler<HTMLDivElement>
onTimeUpdate?
Section titled “onTimeUpdate?”ReactEventHandler<HTMLDivElement>
onTimeUpdateCapture?
Section titled “onTimeUpdateCapture?”ReactEventHandler<HTMLDivElement>
onToggle?
Section titled “onToggle?”ToggleEventHandler<HTMLDivElement>
onTouchCancel?
Section titled “onTouchCancel?”TouchEventHandler<HTMLDivElement>
onTouchCancelCapture?
Section titled “onTouchCancelCapture?”TouchEventHandler<HTMLDivElement>
onTouchEnd?
Section titled “onTouchEnd?”TouchEventHandler<HTMLDivElement>
onTouchEndCapture?
Section titled “onTouchEndCapture?”TouchEventHandler<HTMLDivElement>
onTouchMove?
Section titled “onTouchMove?”TouchEventHandler<HTMLDivElement>
onTouchMoveCapture?
Section titled “onTouchMoveCapture?”TouchEventHandler<HTMLDivElement>
onTouchStart?
Section titled “onTouchStart?”TouchEventHandler<HTMLDivElement>
onTouchStartCapture?
Section titled “onTouchStartCapture?”TouchEventHandler<HTMLDivElement>
onTransformChange?
Section titled “onTransformChange?”(transform) => void
Called when the transform changes (gestures or imperative API).
onTransitionCancel?
Section titled “onTransitionCancel?”TransitionEventHandler<HTMLDivElement>
onTransitionCancelCapture?
Section titled “onTransitionCancelCapture?”TransitionEventHandler<HTMLDivElement>
onTransitionEnd?
Section titled “onTransitionEnd?”TransitionEventHandler<HTMLDivElement>
onTransitionEndCapture?
Section titled “onTransitionEndCapture?”TransitionEventHandler<HTMLDivElement>
onTransitionRun?
Section titled “onTransitionRun?”TransitionEventHandler<HTMLDivElement>
onTransitionRunCapture?
Section titled “onTransitionRunCapture?”TransitionEventHandler<HTMLDivElement>
onTransitionStart?
Section titled “onTransitionStart?”TransitionEventHandler<HTMLDivElement>
onTransitionStartCapture?
Section titled “onTransitionStartCapture?”TransitionEventHandler<HTMLDivElement>
onVolumeChange?
Section titled “onVolumeChange?”ReactEventHandler<HTMLDivElement>
onVolumeChangeCapture?
Section titled “onVolumeChangeCapture?”ReactEventHandler<HTMLDivElement>
onWaiting?
Section titled “onWaiting?”ReactEventHandler<HTMLDivElement>
onWaitingCapture?
Section titled “onWaitingCapture?”ReactEventHandler<HTMLDivElement>
onWheel?
Section titled “onWheel?”WheelEventHandler<HTMLDivElement>
onWheelCapture?
Section titled “onWheelCapture?”WheelEventHandler<HTMLDivElement>
onZoomEnd?
Section titled “onZoomEnd?”() => void
Called when a zoom gesture ends (after a brief idle period).
onZoomStart?
Section titled “onZoomStart?”() => void
Called when a zoom gesture starts.
false | ViewportPanConfig
Pan gesture configuration, or false to disable all pan gestures.
Default
{ button: 'middle', spaceKey: true }string
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
popover?
Section titled “popover?”"" | "auto" | "manual" | "hint"
popoverTarget?
Section titled “popoverTarget?”string
popoverTargetAction?
Section titled “popoverTargetAction?”"toggle" | "hide" | "show"
prefix?
Section titled “prefix?”string
property?
Section titled “property?”string
radioGroup?
Section titled “radioGroup?”string
Ref<ViewportHandle>
Imperative handle (fitToContent, centerOn, etc.).
string
resource?
Section titled “resource?”string
responsive?
Section titled “responsive?”boolean = false
Whether the viewport fills its parent (uses ResizeObserver).
Default
falseresults?
Section titled “results?”number
string
string = 'application'
ARIA role applied to the viewport wrapper.
Default
'application'security?
Section titled “security?”string
selectionRect?
Section titled “selectionRect?”Marquee selection rectangle. Disabled by default.
Default
{ enabled: false }string
spellCheck?
Section titled “spellCheck?”Booleanish
style?
Section titled “style?”CSSProperties
Custom inline styles
suppressContentEditableWarning?
Section titled “suppressContentEditableWarning?”boolean
suppressHydrationWarning?
Section titled “suppressHydrationWarning?”boolean
tabIndex?
Section titled “tabIndex?”number
testId?
Section titled “testId?”string
Test identifier for automated testing
title?
Section titled “title?”string
transform?
Section titled “transform?”Controlled transform.
translate?
Section titled “translate?”"yes" | "no"
typeof?
Section titled “typeof?”string
unselectable?
Section titled “unselectable?”"off" | "on"
vocab?
Section titled “vocab?”string
false | ViewportZoomConfig
Zoom gesture configuration, or false to disable all zoom gestures.
Default
{ wheel: true, pinch: true }Returns
Section titled “Returns”ReactElement
Example
Section titled “Example”<Viewport responsive selectionRect={{ enabled: true }}> <ViewportLayer name="grid" draw={drawGrid} invalidateOn={[gridStep]} /> <ViewportLayer name="content" draw={drawNodes} invalidateOn={[nodes]} /> <ViewportWorld> <NodeView style={{ position: 'absolute', left: 100, top: 200 }} /> </ViewportWorld> <ViewportOverlay> <Toolbar /> </ViewportOverlay></Viewport>