{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"liquid-blob-cursor","type":"registry:component","title":"Liquid Blob Cursor Follow","description":"A soft blurred blob that trails the cursor with spring-smoothed lag.","dependencies":["framer-motion"],"registryDependencies":[],"files":[{"path":"components/viberdy/liquid-blob-cursor.tsx","content":"\"use client\";\n\nimport { useRef } from \"react\";\nimport { motion, useMotionValue, useSpring } from \"framer-motion\";\n\nexport function LiquidBlobCursor({\n  size = 90,\n  softness = 18,\n}: {\n  size?: number;\n  softness?: number;\n}) {\n  const areaRef = useRef<HTMLDivElement>(null);\n  const x = useMotionValue(0);\n  const y = useMotionValue(0);\n  const springX = useSpring(x, { stiffness: 120, damping: 16, mass: 0.6 });\n  const springY = useSpring(y, { stiffness: 120, damping: 16, mass: 0.6 });\n\n  function handleMove(e: React.MouseEvent<HTMLDivElement>) {\n    const rect = areaRef.current?.getBoundingClientRect();\n    if (!rect) return;\n    x.set(e.clientX - rect.left);\n    y.set(e.clientY - rect.top);\n  }\n\n  return (\n    <div\n      ref={areaRef}\n      onMouseMove={handleMove}\n      className=\"relative h-64 w-full overflow-hidden rounded-2xl bg-neutral-100\"\n    >\n      <motion.div\n        className=\"pointer-events-none absolute rounded-full bg-red-500\"\n        style={{\n          width: size,\n          height: size,\n          x: springX,\n          y: springY,\n          translateX: \"-50%\",\n          translateY: \"-50%\",\n          filter: `blur(${softness}px)`,\n          opacity: 0.75,\n        }}\n      />\n    </div>\n  );\n}\n","type":"registry:component","target":"components/viberdy/liquid-blob-cursor.tsx"}],"meta":{"tier":"free","tags":["cursor","blob","spring","follow"],"href":"https://viberdy.dev/library/liquid-blob-cursor","aiPrompt":"Create a React + Tailwind + Framer Motion \"liquid blob cursor follow\" component named LiquidBlobCursor.\n\nBehavior:\n- A soft, heavily-blurred colored circle that follows the mouse cursor within a bounded container, trailing slightly behind with spring physics rather than snapping instantly to the pointer.\n- Track raw cursor position via two Framer Motion useMotionValue instances (x, y), updated directly with .set() inside an onMouseMove handler on the container — do NOT use React useState for the raw position, that would re-render on every mousemove event and is unnecessary since motion values update outside React's render cycle.\n- Wrap each raw motion value in useSpring (stiffness ~120, damping ~16, mass ~0.6) to get a smoothed, lagging version, and feed THAT into the blob's style.x / style.y — this produces the \"liquid\" trailing-follow feel instead of a rigid 1:1 cursor lock.\n- The blob itself: an absolutely-positioned div with a large blur() filter, translated by -50%/-50% so it's centered on the tracked point, sized and colored via props.\n- Compute cursor position relative to the container (via the container's own ref and getBoundingClientRect), not viewport-absolute coordinates, so the effect works correctly no matter where the container sits on the page.\n- Props: size (blob diameter), softness (blur radius in px).\n\nStyle: single accent-colored blurred circle, semi-transparent, contained within a bounded box with overflow-hidden.\n\nOutput a single self-contained \"use client\" component.","license":"https://viberdy.dev/license"}}