loading code fetching the highlighted snippet
The simplest motion lesson: declare initial, animate, and a transition. Motion tweens between them as the element enters. Replay to remount.
initial sets the values on mount; animate is the target. Motion tweens between them when the component enters
the DOM — no manual lifecycle wiring required.transition controls the duration, easing, and type. Here it's a 600ms
linear tween — swap in type: 'spring' for physics-based motion, or set duration: 0 to skip the tween entirely.{#key} block — Svelte
tears the button down and re-mounts it, so motion runs the entrance tween again. Same
trick works for any single-shot animation.