{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-shimmer",
  "title": "Text Shimmer",
  "description": "Animated shimmer effect for text with customizable timing and spread",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/blocks/animations/text-shimmer/components/elements/text-shimmer.tsx",
      "content": "\"use client\";\n\nimport React, { type JSX, useMemo } from \"react\";\n\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport type TextShimmerProps = {\n  children: string;\n  as?: React.ElementType;\n  className?: string;\n  duration?: number;\n  spread?: number;\n  delay?: number;\n  repeatDelay?: number;\n};\n\nfunction TextShimmerBase({\n  children,\n  as: Component = \"p\",\n  className,\n  duration = 2,\n  spread = 2,\n  delay = 0,\n  repeatDelay = 0,\n}: TextShimmerProps) {\n  const MotionComponent = motion.create(\n    Component as keyof JSX.IntrinsicElements,\n  );\n\n  const dynamicSpread = useMemo(() => {\n    return children.length * spread;\n  }, [children, spread]);\n\n  return (\n    <MotionComponent\n      data-slot=\"text-shimmer\"\n      className={cn(\n        \"relative inline-block bg-[length:250%_100%,auto] bg-clip-text\",\n        \"text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]\",\n        \"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]\",\n        \"dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]\",\n        className,\n      )}\n      initial={{ backgroundPosition: \"105% center\" }}\n      animate={{ backgroundPosition: \"-5% center\" }}\n      transition={{\n        repeat: Number.POSITIVE_INFINITY,\n        duration,\n        ease: \"linear\",\n        delay,\n        repeatDelay,\n      }}\n      style={\n        {\n          \"--spread\": `${dynamicSpread}px`,\n          backgroundImage: `var(--bg), linear-gradient(var(--base-color), var(--base-color))`,\n        } as React.CSSProperties\n      }\n    >\n      {children}\n    </MotionComponent>\n  );\n}\n\nexport const TextShimmer = React.memo(TextShimmerBase);\n",
      "type": "registry:component"
    },
    {
      "path": "registry/default/blocks/animations/text-shimmer/routes/layout.tsx",
      "content": "import { Geist, Geist_Mono } from \"next/font/google\";\n\nconst geistSans = Geist({\n  variable: \"--font-geist-sans\",\n  subsets: [\"latin\"],\n});\n\nconst geistMono = Geist_Mono({\n  variable: \"--font-geist-mono\",\n  subsets: [\"latin\"],\n});\n\nexport default function RootLayout({\n  children,\n}: Readonly<{\n  children: React.ReactNode;\n}>) {\n  return (\n    <html lang=\"en\">\n      <body\n        className={`${geistSans.variable} ${geistMono.variable} antialiased`}\n      >\n        {children}\n      </body>\n    </html>\n  );\n}\n",
      "type": "registry:page",
      "target": "app/layout.tsx"
    },
    {
      "path": "registry/default/blocks/animations/text-shimmer/routes/page.tsx",
      "content": "import { TextShimmer } from \"@/registry/default/blocks/animations/text-shimmer/components/elements/text-shimmer\";\n\nexport default function TextShimmerPage() {\n  return (\n    <div className=\"min-h-screen bg-background text-foreground\">\n      <div className=\"container mx-auto px-4 py-16\">\n        <div className=\"max-w-4xl mx-auto space-y-12\">\n          <div className=\"text-center space-y-4\">\n            <h1 className=\"text-3xl font-bold\">Text Shimmer</h1>\n            <p className=\"text-muted-foreground\">\n              Animated shimmer effect for text with customizable timing and\n              spread.\n            </p>\n          </div>\n\n          <div className=\"flex flex-col items-center gap-8\">\n            <TextShimmer className=\"text-4xl font-bold\" duration={2}>\n              Shimmer Effect\n            </TextShimmer>\n            <TextShimmer className=\"text-2xl font-medium\" duration={1.5}>\n              Loading content...\n            </TextShimmer>\n            <TextShimmer className=\"text-lg\" duration={3} spread={3}>\n              Custom spread and duration\n            </TextShimmer>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:page",
      "target": "app/text-shimmer/page.tsx"
    }
  ],
  "docs": "Polymorphic text component with animated shimmer effect. Supports light/dark mode, customizable duration, spread, delay, and repeatDelay props.",
  "categories": [
    "animations"
  ],
  "type": "registry:block"
}