Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-carousel.json --yes

Carousel

Pro

A strip of pictures that scroll sideways, two in view, with previous and next buttons, for a gallery or a product's photos, for React and Tailwind CSS. Part of Goop Pro.

Step the strip with the narrow controls at its edges (each hides at its end), or scroll it sideways; press a panel to open it large, and close it with Escape or the cross. The panels are colour blocks of our own standing in for photographs.

When to use

  • A strip of pictures that scroll sideways, two in view, with previous and next buttons, for a gallery or a product's photos.
  • Also called: slideshow or image slider.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Carousel on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-carousel.json --yes
PROMPT
Add the Goop Carousel to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { Carousel, CarouselItem } from '@/components/ui/goop/carousel';

<Carousel previousLabel="Previous picture" nextLabel="Next picture">
  <CarouselItem buttonLabel="Open the harbour picture" onClick={() => window.open('/pictures/harbour.jpg')}>
    <img src="/pictures/harbour.jpg" alt="" />
  </CarouselItem>
  <CarouselItem buttonLabel="Open the market picture" onClick={() => window.open('/pictures/market.jpg')}>
    <img src="/pictures/market.jpg" alt="" />
  </CarouselItem>
  <CarouselItem buttonLabel="Open the bridge picture" onClick={() => window.open('/pictures/bridge.jpg')}>
    <img src="/pictures/bridge.jpg" alt="" />
  </CarouselItem>
</Carousel>
  • Fits: record: header (media: primary).
  • height, width, padding, corner, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
previousLabel?string = 'Previous pictures'The previous control's name for a screen reader.
nextLabel?string = 'Next pictures'The next control's name for a screen reader.
positionLabel?(position: number, count: number) => stringThe words a screen reader is told when the strip moves ("2 of 5" by default).
Parts
PartWhat it is
CarouselItemOne picture of the strip; children: ReactNode — The picture, an img or your own, at the slide's width; buttonLabel?: string = 'Open picture' — The picture's button's spoken name, with onClick; onClick?: ComponentProps<'button'>['onClick'] — What a press on the picture does (open it large); without it, no button
  • data-slot values (to select a part by): carousel, carousel-cell, carousel-frame, carousel-item, carousel-item-button, carousel-next, carousel-next-icon, carousel-position, carousel-previous, carousel-previous-icon, carousel-track, carousel-viewport

Accessibility

  • The native element answers the keyboard.
  • hover, active, focus-visible, focus-within: the browser's own (:hover, :active, :focus-visible, :focus-within): write nothing

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/carousel.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-carousel.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.