Skip to content

Carousel

A labelled carousel region. Each child of the default slot is one slide. Slides scroll with native scroll snapping, so touch, trackpad and keyboard scrolling work without the script; the arrows move one page of slides and wrap back to the start at the end.

  • label: accessible name for the carousel region (default "Carousel")
  • perView: 1 (default), 2, 3, 4, auto. Multi-slide views show 1.25 slides on small screens, 2 from 40rem, and the full count from 64rem. auto keeps each slide’s own width
  • gap: spacing scale step between slides, 1 to 10 (default 4)
  • dots: adds one dot button per slide, marking the current one
  • overlay: places the controls over the bottom of the slides in white, for full-bleed slideshows
  • autoplay: advances one page at a time and shows a pause button. Pauses while hovered or focused, and stays off under reduced motion
  • interval: autoplay delay in milliseconds (default 6000)
<Carousel label="What's in Samla" perView="3" dots>
{pieces.map((piece) => <Card title={piece.title} description={piece.description} />)}
</Carousel>
perView="4"
perView="auto"
overlay, dots and autoplay