{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "rotating-words",
  "title": "Rotating Words",
  "author": "VenusUI",
  "description": "Cycles through words with a vertical slide, pausing on hover.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "registry/default/ui/rotating-words.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface RotatingWordsProps {\n  /** Words to cycle through. */\n  words: string[]\n  /** Milliseconds each word stays visible. */\n  interval?: number\n  className?: string\n}\n\n/**\n * Swaps one word for the next with a vertical slide. Pauses while hovered.\n * Screen readers hear the full list once. With reduced motion the first word\n * is shown without rotating.\n */\nfunction RotatingWords({ words, interval = 2500, className }: RotatingWordsProps) {\n  const reduceMotion = useReducedMotion()\n  const [index, setIndex] = React.useState(0)\n  const [paused, setPaused] = React.useState(false)\n\n  React.useEffect(() => {\n    if (reduceMotion || paused || words.length < 2) return\n    const timer = setInterval(() => setIndex((i) => (i + 1) % words.length), interval)\n    return () => clearInterval(timer)\n  }, [reduceMotion, paused, words.length, interval])\n\n  const word = reduceMotion ? words[0] : words[index]\n\n  return (\n    <span\n      data-slot=\"rotating-words\"\n      className={cn(\"relative inline-flex overflow-hidden align-bottom\", className)}\n      onPointerEnter={() => setPaused(true)}\n      onPointerLeave={() => setPaused(false)}\n    >\n      <span className=\"sr-only\">{words.join(\", \")}</span>\n      <AnimatePresence mode=\"wait\" initial={false}>\n        <motion.span\n          key={word}\n          aria-hidden=\"true\"\n          className=\"inline-block\"\n          initial={{ y: \"100%\", opacity: 0 }}\n          animate={{ y: 0, opacity: 1 }}\n          exit={{ y: \"-100%\", opacity: 0 }}\n          transition={{ duration: 0.35, ease: [0.22, 1, 0.36, 1] }}\n        >\n          {word}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  )\n}\n\nexport { RotatingWords, type RotatingWordsProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "text",
    "animations"
  ],
  "type": "registry:ui"
}