Installation
npx kinetic-ui-cli@latest add svg-path-tracing
How It Works
This component uses Framer Motion's useScroll to track the user's vertical scroll progress within the container.
It then maps that progress [0, 1] to the pathLength style property of the SVG <motion.path>.
We pass the scrollYProgress value through a useSpring hook to give the drawing animation a smooth, fluid feeling instead of rigidly locking to the exact scroll pixel.
Usage Guide
1. Import the Component
Import the component into your React or Next.js page:
import { SvgPathTracing } from "@/components/creative/svg-path-tracing";
2. Implementation Example
Render the component and customize its behavior by passing props:
import { SvgPathTracing } from "@/components/creative/svg-path-tracing";
export default function Example() {
return (
<div className="w-full flex items-center justify-center p-8">
<SvgPathTracing
path="example"
strokeColor="example"
strokeWidth{10}
/>
</div>
);
}