Experiments >

Code animation: Range tween

Experiment #190 ● 17th May, 2021 ● by Joshua Nussbaum

Svelte’s tweened store animates between an initial value and an arbitrary value. But sometimes you want to restrict what the values can be.

This is what a “range store” does. The from and to values are defined when the store is intitialized. store.run() is used to animate from one to the other.

Code

https://svelte.dev/repl/c90aea54f17c4024b467e3a33299fefa?version=3.38.2

Demo

Notes

view all experiments

Stay tuned in

Learn how to add more experimentation to your workflow