Screenshot Carousel
ProNewScreenshots in a row that scrolls and snaps like an app store listing, with the middle one in focus, a caption that follows it, arrows and dots.
Installation
pnpm dlx shadcn@latest add @viewport/screenshot-carousel
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| slides* | { id: string; content: React.ReactNode; caption: string }[]One slide per screenshot. `content` is the picture or a framed device; `caption` says what it shows. | — |
| label | stringAccessible name, e.g. "Screenshots of the app". | "Screenshots" |
| slideWidth | stringHow wide a slide is, as a fixed CSS length such as "12rem". Narrower slides let more of their neighbors show. | "12rem" |
| className | string | — |
Accessibility
- Native scrolling: swipe, trackpad and arrow keys work without script.
- Each slide is named with its position and caption.
- The caption is announced as the slide changes.
- Arrows disable at the ends; dots have full-size targets.
- Buttons jump instead of gliding under reduced motion.