Tween
Bindings for @solid-primitives/tween.
Easing
type Easing = float -> float
createTween
let createTween(
target: Accessor<'T>,
?duration: int,
?easing: Easing
): Accessor<'T>
A derived signal that moves smoothly from the target's previous value to its new one whenever it changes. The target can be any accessor; to tween a component prop, pass fun () -> props.value.
| Param | Desc |
|---|---|
target | The reactive value to follow. |
duration | How many milliseconds the transition from one value to the next takes. Defaults to 100. |
easing | A function that maps a number between 0. and 1., to speed up or slow down parts of the transition. Defaults to linear. |
Updates run on requestAnimationFrame, and stop once the value reaches the target.
Easings
The binding ships a set of easing functions written in F#, with no dependencies:
| In | Out | In and out |
|---|---|---|
easeInSine | easeOutSine | easeInOutSine |
easeInQuad | easeOutQuad | easeInOutQuad |
easeInCubic | easeOutCubic | easeInOutCubic |
easeInQuart | easeOutQuart | easeInOutQuart |
easeInQuint | easeOutQuint | easeInOutQuint |
easeInExpo | easeOutExpo | easeInOutExpo |
easeInCirc | easeOutCirc | easeInOutCirc |
easeInBack | easeOutBack | easeInOutBack |
easeInElastic | easeOutElastic | easeInOutElastic |
easeInBounce | easeOutBounce | easeInOutBounce |
