{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scroll-progress",
  "title": "Scroll Progress",
  "description": "Reading-progress bar driven by scroll position.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "@atroui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/scroll-progress.tsx",
      "content": "\"use client\"\n\nimport {\n  motion,\n  type SpringOptions,\n  useScroll,\n  useSpring,\n} from \"motion/react\"\nimport type { RefObject } from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type ScrollProgressProps = {\n  className?: string\n  springOptions?: SpringOptions\n  containerRef?: RefObject<HTMLDivElement | null>\n}\n\nconst DEFAULT_SPRING_OPTIONS: SpringOptions = {\n  stiffness: 200,\n  damping: 50,\n  restDelta: 0.001,\n}\n\nexport function ScrollProgress({\n  className,\n  springOptions,\n  containerRef,\n}: ScrollProgressProps) {\n  const { scrollYProgress } = useScroll({\n    container: containerRef,\n  })\n\n  const scaleX = useSpring(scrollYProgress, {\n    ...DEFAULT_SPRING_OPTIONS,\n    ...(springOptions ?? {}),\n  })\n\n  return (\n    <motion.div\n      className={cn(\"inset-x-0 top-0 h-1 origin-left\", className)}\n      style={{\n        scaleX,\n      }}\n    />\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/ui/scroll-progress.tsx"
    }
  ],
  "type": "registry:ui"
}