motion-sv@0.1.11
Patch Changes
New Features
-
useCurrentMotionValue- Creates a reactive wrapper around a MotionValue with acurrentgetter, similar to Svelte's nativeTweenandSpringclasses. This allows using MotionValue in reactive contexts where.get()wouldn't trigger reactivity. (#3)<script> import { useMotionValue, useCurrentMotionValue } from 'motion-sv'; const x = useMotionValue(0); const reactiveX = useCurrentMotionValue(x); </script> <p>Current x: {reactiveX.current}</p>
-
useFollowValue- New hook for following values with customizable animation options. -
useClipPathWorkaround- Opt-in workaround for Chrome's IntersectionObserver behavior withclipPathandwhileInView. Chrome correctly computes intersection based on visible/painted area, which means fully-clipped elements won't triggerwhileInView. Enable viainViewOptions. (#9)<motion.div initial={{ clipPath: "inset(0% 100% 0% 0%)" }} whileInView={{ clipPath: "inset(0% 0% 0% 0%)" }} inViewOptions={{ useClipPathWorkaround: true }} />
-
Reactive
inputRangeinuseTransform- UsereactiveInputRange()for dynamic breakpoints that update the transform when changed. -
Multi-output
useTransform- Transform a single input into multiple outputs:const { opacity, scale } = useTransform(x, [0, 100], { opacity: [0, 1], scale: [0.5, 1], });
-
Native scroll timeline support -
useScrollnow supports acceleration config for native scroll timeline animations when the browser supports it. -
Export
MotionStyletype - Now exported from the main entry point.
Improvements
-
useAnimatescoping fix - Refactored with proper proxy-based scope to ensure animations are correctly scoped to the component. (#7) -
useSpringrefactor - Now usesattachFollowfrom motion-dom for improved performance and consistency. -
useInViewAPI change - Renamed.isInViewto.currentfor consistency with Svelte conventions.
Dependencies
framer-motion: ^12.23.12 → ^12.38.0motion-dom: ^12.23.12 → ^12.38.0motion-utils: ^12.23.6 → ^12.36.0
Breaking Changes
useInView().isInViewis nowuseInView().current