Spring Easing
The sliders come, by default with a Svelte Spring animation. This uses the internal spring()
function from Svelte. The properties of the spring()
(stiffness
, damping
) can be set with this springValues
property.
Default Spring
The default animation is not especially noticeable when moving the handle manually. But when clicking from one end to the other, the large distance travelled is animated and much more noticeable.
Custom Spring
Here’s a demonstration of the Slider with modified springValues
property. The stiffness
and damping
values have been bound to the inputs below the Slider.
Move the easing/damping sliders to update the springy-ness of the first slider’s animation.