Scroll Gallery Demo
sora-ui/demo-scroll-galleryFreeComponent
Sticky scroll slider with 4 slides, strip-mask transitions, and animated title swaps.
Install it
npx shadcn@latest add https://ui.soralabs.io.vn/r/demo-scroll-gallery.jsonSource
1"use client";23import { useEffect, useRef, useState } from "react";4import { CatalogScrollHint } from "@/components/catalog/catalog-scroll-hint";5import { resolveScrollRoot } from "@/lib/catalog/resolve-scroll-root";6import { scrollGalleryDemoSlides } from "@/lib/demo/scroll-gallery-demo-slides";7import { waitForScrollerReady } from "@/lib/scroll/scroller-ready";8import { ScrollGallery } from "@/components/sora-ui/effects/scroll-gallery";910export default function ScrollGalleryDemo() {11 const rootRef = useRef<HTMLDivElement>(null);12 const [scroller, setScroller] = useState<Element | Window | undefined>();1314 useEffect(() => {15 const node = rootRef.current;16 if (!node) {17 return;18 }1920 const resolved = resolveScrollRoot(node);2122 waitForScrollerReady(resolved)23 .then(() => {24 setScroller(resolved);25 })26 .catch(() => {27 /* preview unmounted */28 });29 }, []);3031 return (32 <div className="w-full" ref={rootRef}>33 <CatalogScrollHint label="Scroll to reveal slides" />3435 {scroller ? (36 <ScrollGallery37 containerQuery38 embedded39 linkLabel="Explore"40 prefixLabel="Featured"41 scroller={scroller}42 slides={scrollGalleryDemoSlides}43 variant="studio"44 />45 ) : null}46 </div>47 );48}
What it pulls in
Other registry items
Files it writes
More from Sora UI
All 97 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Sora UI | Components | Free | 2 deps | |
| Border Trailborder-trail | Sora UI | Components | Free | 1 dep | |
| Bottom Sheetbottom-sheet | Sora UI | Components | Free | 2 deps | |
| Cursor Bubblecursor-bubble | Sora UI | Components | Free | 2 deps | |
| Cursor Trail Revealcursor-trail-reveal | Sora UI | Components | Free | 1 dep | |
| Custom Cursorcustom-cursor | Sora UI | Components | Free | 2 deps | |
| Accordion Demodemo-accordion | Sora UI | Components | Free | no deps | |
| Border Trail Demodemo-border-trail | Sora UI | Components | Free | no deps |
