Skip to content
Ooidget

Ooidget Component Format 0.1Editor's Draft

Motion

A widget’s motions names values that follow a target in the view over time, for drawing only: an indicator that eases to a new position, a meter’s falling peak.

"motions": {
  "needle": { "follow": "s.value", "duration": 180, "easing": "cubic-bezier(0.2, 0, 0, 1)" },
  "thumb":  { "follow": "s.value", "spring": { "stiffness": 300, "damping": 30 } }
}
PropertyTypeDescription
followExpression<number>The target.
durationnumberMilliseconds to reach a new target.
easingstringA CSS <easing-function> [CSS-EASING-1]. Absent: ease.
springobjectInstead of duration and easing: a damped spring, stiffness and damping per unit mass.

Expressions read the current value as m.needle. A motion starts at its target’s first value. When the target changes during a motion, the motion continues from its current value and velocity. When the user prefers reduced motion (env.reducedMotion), a runtime MUST set each motion to its target at once.

Motion values never reach behaviours: a behaviour sees the view, not m.