QORMQORM v0.8.4 api Get started

Gestures

QORM ships touch/pointer gestures as widget props — no JavaScript to write.

gesturehow
tap / double-tap / long-pressonPress / onDoubleTap / onLongPress on any node
scene swipe (game controls)a scene-level swipes map — {"left": "slideLeft", …} — the touch counterpart of the scene's keys; a press that drags in one dominant direction and releases dispatches the bound action, so the same game plays with arrow keys on desktop and swipes on a phone
swipe-to-dismissa dismissible widget with onDismissed
swipe-to-reveal actionsa swipeactions widget with an actions list
swipeable pagesa horizontal scroll (scroll-snap)
pull-to-refresha scroll with onRefresh
drag-to-reordera list with reorderable: true + onReorder
context menucontextMenu on a node
drag-and-dropdraggabledragtarget cross-panel drag
hover feedbackhoverBackground, hoverOpacity, hoverScale on any node
press feedbackpressedBackground, pressedOpacity, pressedScale on any node
animated transitionstransition: "0.2s" on any node animates interaction effects
scroll momentumviewports coast after wheel/trackpad input with inertia
board pan momentuminfinite canvas coasts after drag release

Text input editing (native canvas backend)

The native canvas window implements a full text editing system:

double-click selects a word, triple-click selects a line (textarea) or the whole field (single-line), drag selects text.

values are folded to single-line for <input>). The system clipboard is accessed via pbcopy/pbpaste on macOS.

undo stack is capped at 50 entries.

start/end (textarea) or buffer start/end (input), Up/Down by visual line (textarea only).

deletes after; both replace the selection when non-empty.

the real buffer is what copy and state write-back use.

one .; min, max, step props clamp the committed value.

but prevents editing.

the buffer (the host's text-input-client seam fills it).

Scroll momentum

The native canvas engine applies inertia to scroll viewports after wheel/trackpad input stops:

consumed deltas, so continuous trackpad input builds smooth speed and discrete wheel events produce a subtle carry-forward.

frame — a 16ms frame gets one friction step, a 32ms frame gets two.

within the last 2ms (the event handler already applied its own delta).

the layout-time clamp (scrollOffsetPos) repairs any overshoot at the ceiling.

all velocities drop below 0.3 px/frame.

Board pan momentum

The infinite-canvas board root coasts after a drag release:

displacement between consecutive moves and smooths it with EMA (α=0.2).

decayed with 0.92^frames — a longer, floatier feel than scroll momentum (≈50 frames / 833ms to settle).

coast, so the next drag starts from a clean state.

Animated interaction transitions

Any node can declare a transition duration ("0.2s", "200ms") that animates interaction-effect changes instead of snapping them:

node on press and back on release, via a Float64Tween through the theme's easing curve.

animate alongside the scale.

Disabled visual dimming

Disabled nodes ("disabled": true in style) automatically render at 50% opacity on the native canvas backend:

disabled visuals and are excluded from generic dimming to prevent double-dimming.

not-allowed cursor, and are excluded from the Tab order — all at the engine level with no per-widget logic needed.