{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "spotlight-section-shadcnui", "type": "registry:ui", "title": "Spotlight Section", "description": "Container where mouse creates soft radial spotlight following cursor", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/motion-core/spotlight-section.tsx", "content": "\"use client\";\n\nimport { motion, useMotionValue, useSpring } from \"framer-motion\";\nimport { MouseEvent, useState } from \"react\";\n\ntype SpotlightSectionProps = {\n children: React.ReactNode;\n intensity?: number;\n size?: number;\n};\n\nexport function SpotlightSection({\n children = (\n
\n

Spotlight Section

\n

\n Move your mouse around to see the spotlight effect\n

\n
\n ),\n intensity = 0.6,\n size = 300,\n}: SpotlightSectionProps) {\n const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });\n const [isActive, setIsActive] = useState(false);\n\n const x = useMotionValue(0);\n const y = useMotionValue(0);\n\n const springX = useSpring(x, { stiffness: 300, damping: 30 });\n const springY = useSpring(y, { stiffness: 300, damping: 30 });\n\n const handleMouseMove = (e: MouseEvent) => {\n const rect = e.currentTarget.getBoundingClientRect();\n const xPos = e.clientX - rect.left;\n const yPos = e.clientY - rect.top;\n\n x.set(xPos);\n y.set(yPos);\n setMousePosition({ x: xPos, y: yPos });\n setIsActive(true);\n };\n\n const handleMouseLeave = () => {\n setIsActive(false);\n };\n\n return (\n \n \n\n
{children}
\n \n );\n}\n", "type": "registry:ui", "target": "components/uitripled/spotlight-section-shadcnui.tsx" } ] }