{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auto-revealing-heading-shadcnui",
  "type": "registry:page",
  "title": "Auto-Revealing Heading",
  "description": "Heading that reveals each letter/word with staggered motion on scroll",
  "dependencies": [
    "framer-motion",
    "react"
  ],
  "files": [
    {
      "path": "@uitripled/react-shadcn/src/components/motion-core/auto-revealing-heading.tsx",
      "content": "\"use client\";\n\nimport { motion, useInView, type Variants } from \"framer-motion\";\nimport { useRef } from \"react\";\n\ntype AutoRevealingHeadingProps = {\n  text: string;\n  splitBy?: \"letter\" | \"word\";\n  delay?: number;\n  className?: string;\n};\n\nexport function AutoRevealingHeading({\n  text = \"Auto Revealing Heading\",\n  splitBy = \"word\",\n  delay = 0.1,\n  className = \"\",\n}: AutoRevealingHeadingProps) {\n  const ref = useRef(null);\n  const isInView = useInView(ref, { once: true, margin: \"-100px\" });\n\n  const words = splitBy === \"word\" ? text.split(\" \") : text.split(\"\");\n\n  const containerVariants: Variants = {\n    hidden: { opacity: 0 },\n    visible: {\n      opacity: 1,\n      transition: {\n        staggerChildren: delay,\n      },\n    },\n  };\n\n  const itemVariants: Variants = {\n    hidden: { opacity: 0, y: 20 },\n    visible: {\n      opacity: 1,\n      y: 0,\n      transition: {\n        type: \"spring\",\n        stiffness: 300,\n        damping: 25,\n      },\n    },\n  };\n\n  return (\n    <motion.div\n      ref={ref}\n      variants={containerVariants}\n      initial=\"hidden\"\n      animate={isInView ? \"visible\" : \"hidden\"}\n      className={className}\n    >\n      {words.map((word, index) => (\n        <motion.span\n          key={index}\n          variants={itemVariants}\n          className=\"inline-block\"\n          style={{ marginRight: splitBy === \"word\" ? \"0.25em\" : \"0.1em\" }}\n        >\n          {word}\n        </motion.span>\n      ))}\n    </motion.div>\n  );\n}\n",
      "type": "registry:page",
      "target": "components/uitripled/auto-revealing-heading-shadcnui.tsx"
    }
  ]
}