Skip to content
QuireKit
Core docs
Alpha · evolving API
API and referenceView Markdown ↗

View: adapters and workspace options

Backend choice, runtime options, geometry queries and freshness.

Register and select

Canvas/SVG hosts also import @quirekit/view/styles.css for base positioning of content, overlay and input layers. The host supplies its theme and workspace dimensions; standalone Core integration does not depend on Classic product CSS. The complete source and mounting guide include this import.

BackendRegistrationMeaning
canvascanvasViewExtension({ runtime })Canvas content and View-owned input/geometry
svgsvgViewExtension({ runtime })SVG surface with shared pagination semantics
htmlhtmlViewExtension({ runtime }) (@quirekit/view-html)Retained continuous DOM flow, not native DOM view
domDomViewExtension from @quirekit/dom-viewSeparate native contenteditable adapter
@quirekit/viewAGPL-3.0-only

Creates a configured Canvas mounted view extension. @param options - Runtime options for canvas mode. @returns Configured Canvas mounted view extension.

canvasViewExtensionts
@quirekit/viewAGPL-3.0-only

Creates a configured SVG mounted view extension. @param options - Runtime options for SVG mode. @returns Configured SVG mounted view extension.

svgViewExtensionts
@quirekit/view-htmlAGPL-3.0-only

Creates a configured HTML mounted view extension. @param options - Runtime options for HTML mode. @returns Configured HTML mounted view extension.

htmlViewExtensionts

Common Canvas runtime options

OptionPurpose/unitIntegration
width / heightPreferred surface size in CSS pxNot Word units or model page settings
pageStackPer-page presentationProfile/Engine own pagination facts
scrollSource / scrollViewportScroll ownershipUse the same product viewport element
viewportPaddingViewport padding in CSS pxSeparate from document margins
devicePixelRatio / getDevicePixelRatioRaster backing densityNot content zoom
surfaceConfigSelection/object presentationOutside persisted content
mediaResolverStable asset references to resourcesMatch persistence/conversion resources
onRenderCompleted mounted-render factsRead layout snapshot without starting another layout
onVisiblePagesChangeRealized page setNot total page count
textMeasurer / lineBreakerFont measurement and line breakingNeed consistent verified policies

SVG has its own contract, including textMeasurementBackend: 'browser'. Similar field names do not establish interchangeability; type-check each backend. Shared callbacks in the tutorial use QuireMountedViewRenderEvent.

Mounted capabilities

editor.mountedView can be absent; editor.view needs an active primary view. Use focus(), hasFocus() and scrollToSelection() for input/visibility. coordsAtPos() and posAtCoords() use browser client CSS pixels. getCaretRect() and getTextRangeRects(range, sourceDocument) return geometry only when supported and current.

Where required, pass the captured immutable source document. A stale frame returning null/unavailable is a valid refusal, not permission to hit-test new content with old coordinates. Subscribe to onGeometryUpdate() when needed and release its returned subscription.

See the mounting tutorial for the workspace, zoom and mode switching, and Editor API for mount/changeMode options.

QuireKitQuireKit · Core, plugins and Classic docs