Skip to content
Twentyfirst UIPro

Carousel

Media · Carousel, ProductArt

View as Markdown

A row of slides with previous/next buttons and dots. Swipe or scroll on touch, ←/→ on the keyboard.

  • perView shows several slides on wide screens; phones always show one (with a peek of the next).
  • loop wraps around at the ends.
  • The carousel is a labelled region; each slide is announced as "n of total".

Props

PropTypeNotes
slidesReactNode[]Required
labelstringAccessible name of the carousel.
perView?numberSlides visible at once on wide screens (1 on phones).
loop?booleanNext on the last slide goes back to the first.
dots?booleanDots under the slides.
index?number
defaultIndex?number
onChange?(index: number) => void
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

ProductArt

PropTypeNotes
kindArtKindRequired
tint?Tint | "plain"
size?number
label?string
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.