{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scrollable-carousel",
  "title": "Scrollable Carousel",
  "description": "Responsive horizontal carousel with native scrolling, scroll snapping, and accessible previous and next controls.",
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/gallery/ScrollableCarousel.tsx",
      "content": "'use client';\n\nimport { Children, useEffect, useRef, type ReactNode } from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\n\ntype ScrollableCarouselProps = {\n  children: ReactNode;\n  ariaLabel?: string;\n  className?: string;\n  itemClassName?: string;\n};\n\nexport default function ScrollableCarousel({\n  children,\n  ariaLabel = 'Scrollable carousel',\n  className = '',\n  itemClassName = '',\n}: ScrollableCarouselProps) {\n  const scrollerRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    const scroller = scrollerRef.current;\n    if (!scroller) return;\n\n    const onWheel = (event: WheelEvent) => {\n      if (event.ctrlKey || Math.abs(event.deltaX) >= Math.abs(event.deltaY)) return;\n\n      const atStart = scroller.scrollLeft <= 0;\n      const atEnd = scroller.scrollLeft + scroller.clientWidth >= scroller.scrollWidth - 1;\n      if ((event.deltaY < 0 && atStart) || (event.deltaY > 0 && atEnd)) return;\n\n      event.preventDefault();\n      scroller.scrollLeft += event.deltaY;\n    };\n\n    scroller.addEventListener('wheel', onWheel, { passive: false });\n    return () => scroller.removeEventListener('wheel', onWheel);\n  }, []);\n\n  const scroll = (direction: number) => {\n    const scroller = scrollerRef.current;\n    if (!scroller) return;\n    scroller.scrollBy({\n      left: direction * scroller.clientWidth * 0.8,\n      behavior: 'smooth',\n    });\n  };\n\n  return (\n    <section\n      className={['w-full', className].filter(Boolean).join(' ')}\n      role=\"region\"\n      aria-roledescription=\"carousel\"\n      aria-label={ariaLabel}\n    >\n      <div className=\"mb-4 flex justify-end gap-2\">\n        <button\n          type=\"button\"\n          onClick={() => scroll(-1)}\n          className=\"grid size-10 place-items-center rounded-full border border-[color:var(--color-border,#e5e7eb)] bg-[var(--color-background,#fff)] text-lg text-[color:var(--color-foreground,#111827)] transition hover:bg-[var(--color-muted,#f3f4f6)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--color-ring,#111827)]\"\n          aria-label=\"Previous items\"\n        >\n          <ChevronLeft aria-hidden=\"true\" className=\"size-5\" />\n        </button>\n        <button\n          type=\"button\"\n          onClick={() => scroll(1)}\n          className=\"grid size-10 place-items-center rounded-full border border-[color:var(--color-border,#e5e7eb)] bg-[var(--color-background,#fff)] text-lg text-[color:var(--color-foreground,#111827)] transition hover:bg-[var(--color-muted,#f3f4f6)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--color-ring,#111827)]\"\n          aria-label=\"Next items\"\n        >\n          <ChevronRight aria-hidden=\"true\" className=\"size-5\" />\n        </button>\n      </div>\n\n      <div\n        ref={scrollerRef}\n        className=\"flex snap-x snap-mandatory gap-4 overflow-x-auto overscroll-x-contain pb-4 sm:gap-5\"\n      >\n        {Children.map(children, (child) => (\n          <div\n            className={[\n              'w-[88%] shrink-0 snap-start sm:w-[60%] lg:w-[36%]',\n              itemClassName,\n            ]\n              .filter(Boolean)\n              .join(' ')}\n          >\n            {child}\n          </div>\n        ))}\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/gallery/ScrollableCarousel.tsx"
    }
  ],
  "categories": [
    "gallery"
  ],
  "type": "registry:component"
}