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 } }
}| Property | Type | Description |
|---|---|---|
follow | Expression<number> | The target. |
duration | number | Milliseconds to reach a new target. |
easing | string | A CSS <easing-function> [CSS-EASING-1]. Absent: ease. |
spring | object | Instead 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.