Carousel

Slides that scroll and snap, with arrows and dots.

Source

Product screenshots

One screenshot with part of the next one showing. Set arrows when users may not know they can swipe, such as for screenshots on desktop. The arrows show on hover.

Slide 1 of 2

Several slides per view

Wider containers show up to three cards.

Slide 1 of 6

Optional automatic slides

Campus photos advance every five seconds. The active dot fills while the next slide waits. Use the pause button to stop automatic slides.

Slide 1 of 3

Usage

These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.

  • Use a carousel to browse a set of similar items. Do not put content that every user must see after the first slide.
  • Use slides with the same aspect ratio, so the row height stays stable.
  • Use autoplay rarely. It stops when the user focuses or moves the carousel, and it is off for users who prefer reduced motion.

API

Carousel is a site component. Each child becomes one slide. It uses native CSS scroll-snap without a slider dependency.

Carousel

PropTypeDefaultDescription
labelstring–Names the carousel region.
childrenReactNode–One slide per child. Use stable keys when data changes.
slidesPerView1 | 2 | 3 | 41Sets the maximum slide count in a wide container.
peekbooleanfalseShows 10% of the next slide, from 32px to 80px, with a soft edge fade.
autoplaynumber0Sets the delay in milliseconds. Zero disables it. The minimum delay is 1000ms.
dotsbooleantrueShows buttons for distinct scroll stops.
arrowsbooleanfalseShows previous and next buttons on the left and right of the slides. They appear on hover and keyboard focus, and always on touch screens.
onActiveIndexChange(index: number) => void–Receives the zero-based index at the active scroll stop.
className / slideClassNamestring–Adds classes to the region or each slide.