UNPKG

@humanspeak/svelte-motion

Version:

Framer Motion for Svelte 5. Declarative motion.<tag> components with AnimatePresence exit animations, gestures (hover, tap, drag, focus, in-view), variants, FLIP layout animations, shared-layout transitions, spring physics, and scroll-linked motion values

11 lines (10 loc) 509 B
import {} from 'motion-dom'; import {} from 'svelte/store'; import {} from './augmentMotionValue.svelte.js'; import { useFollowValue } from './followValue.svelte.js'; export function useSpring(source, options = {}) { // Cast through `unknown` because TypeScript can't narrow the multi-form // `source` against `useFollowValue`'s overload set; runtime behavior is // identical — `useFollowValue` dispatches on the same shapes. return useFollowValue(source, { type: 'spring', ...options }); }