Your images sit in a backlit viewer like 35mm slides, with the next ones waiting in the magazine. Pull the lever, swipe or use the arrow keys and the next slide drops in. An optional slideshow moves on by itself.
npx shadcn@latest add https://clickworks.dev/r/slide-viewer.jsonThe files land in components/clickworks/slide-viewer/. No other packages are added.
import { SlideViewer } from "@/components/clickworks/slide-viewer/react/SlideViewer"
export function Gallery() {
return (
<SlideViewer
slides={[
{ image: { src: "/work/one.jpg", alt: "Kitchen after the refit" }, caption: "Kitchen" },
{ image: { src: "/work/two.jpg", alt: "Garden room at dusk" }, caption: "Garden room" },
]}
/>
)
}The slides, in order.
Accessible name of the gallery.
Default "Gallery"
Engraved on the viewer.
Auto follows the page (its background, data-theme or dark class), then the device.
Default "auto"
Colours for each theme.
Moves on by itself.
Default false
Seconds per slide in the slideshow.
Default 5
The lever click and a short buzz on phones.
Default true
The slide changed.
Colours come in through the light and dark props. It fills its width and keeps its proportions.