{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-reveal",
  "title": "Text Reveal",
  "author": "VenusUI",
  "description": "Fades, unblurs and lifts text into place word by word as it scrolls into view.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "registry/default/ui/text-reveal.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype TextRevealTag = \"h1\" | \"h2\" | \"h3\" | \"p\" | \"span\"\n\ninterface TextRevealProps {\n  /** The text to reveal, word by word. */\n  text: string\n  /** Element to render. */\n  as?: TextRevealTag\n  /** Seconds before the first word starts. */\n  delay?: number\n  /** Seconds between words. */\n  stagger?: number\n  /** Animate every time it enters the viewport instead of once. */\n  repeat?: boolean\n  className?: string\n}\n\n/**\n * Fades, unblurs and lifts each word into place when the text scrolls into\n * view. The text stays real text, so it is selectable and read normally by\n * screen readers. Renders static text when the user prefers reduced motion.\n */\nfunction TextReveal({ text, as: Tag = \"p\", delay = 0, stagger = 0.06, repeat = false, className }: TextRevealProps) {\n  const reduceMotion = useReducedMotion()\n  const words = text.split(/\\s+/).filter(Boolean)\n\n  if (reduceMotion) {\n    return (\n      <Tag data-slot=\"text-reveal\" className={className}>\n        {text}\n      </Tag>\n    )\n  }\n\n  return (\n    <Tag data-slot=\"text-reveal\" className={cn(className)}>\n      {words.map((word, index) => (\n        <React.Fragment key={`${word}-${index}`}>\n          <motion.span\n            className=\"inline-block will-change-[transform,filter,opacity]\"\n            initial={{ opacity: 0, filter: \"blur(8px)\", y: \"0.35em\" }}\n            whileInView={{ opacity: 1, filter: \"blur(0px)\", y: 0 }}\n            viewport={{ once: !repeat, amount: 0.5 }}\n            transition={{ duration: 0.5, ease: [0.22, 1, 0.36, 1], delay: delay + index * stagger }}\n          >\n            {word}\n          </motion.span>\n          {index < words.length - 1 ? \" \" : null}\n        </React.Fragment>\n      ))}\n    </Tag>\n  )\n}\n\nexport { TextReveal, type TextRevealProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "text",
    "animations"
  ],
  "type": "registry:ui"
}