{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-shimmer",
  "title": "Text Shimmer",
  "description": "A light sweep that moves across text. CSS only — no dependencies.",
  "files": [
    {
      "path": "registry/mewo/ui/text-shimmer.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextShimmerProps extends Omit<React.ComponentProps<\"span\">, \"children\"> {\n  children: string\n  /** Seconds for one light sweep. */\n  duration?: number\n}\n\n/**\n * The light is a copy of the text in the foreground colour, seen through a soft-edged window that slides\n * across while the copy slides back the same distance, so the copy holds still under it. Both only change\n * `transform`, which the compositor animates on its own: the text is painted once instead of on every\n * frame, as an animated gradient behind clipped text would be. The copy is generated content\n * (`content: attr(data-text)`), so the string is in the DOM once and find, copy and textContent see it once.\n */\nexport function TextShimmer({ children, duration = 2, className, style, ...props }: TextShimmerProps) {\n  return (\n    <span\n      data-slot=\"text-shimmer\"\n      className={cn(\"inline-block text-muted-foreground\", className)}\n      style={{ \"--shimmer-duration\": `${duration}s`, ...style } as React.CSSProperties}\n      {...props}\n    >\n      {/* Holds the text box the light is measured against, clear of any padding on the root. */}\n      <span className=\"relative inline-block\">\n        {children}\n        <span\n          aria-hidden\n          data-slot=\"text-shimmer-light\"\n          className=\"pointer-events-none absolute inset-y-0 left-0 w-1/2 overflow-hidden select-none [mask-image:linear-gradient(110deg,transparent,black_50%,transparent)] motion-safe:animate-[mewo-shimmer_var(--shimmer-duration)_linear_infinite] motion-reduce:hidden\"\n        >\n          <span\n            data-text={children}\n            className=\"absolute top-0 left-0 w-[200%] text-foreground before:content-[attr(data-text)] motion-safe:animate-[mewo-shimmer-text_var(--shimmer-duration)_linear_infinite]\"\n          />\n        </span>\n      </span>\n    </span>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "css": {
    "@keyframes mewo-shimmer": {
      "from": {
        "transform": "translateX(-100%)"
      },
      "to": {
        "transform": "translateX(300%)"
      }
    },
    "@keyframes mewo-shimmer-text": {
      "from": {
        "transform": "translateX(50%)"
      },
      "to": {
        "transform": "translateX(-150%)"
      }
    }
  },
  "meta": {
    "added": "2026-09-15"
  },
  "categories": [
    "text"
  ],
  "type": "registry:ui"
}