Start typing to search components and docs…
select navigate ESC close

Carousel

Carousel - modern carousel based on Swiper Element (Web Component)

ABCDA
<swiper-container
  class="max-w-full w-full flex overflow-hidden"
  grid-rows="1"
  mousewheel-force-to-axis="true"
  navigation="true"
  pagination-type="fraction"
  scrollbar="false"
  slides-per-view="auto"
  space-between="0"
>
  <swiper-slide class="bg-blue-50 p-12 border-1 min-w-full">A</swiper-slide>
  <swiper-slide class="bg-blue-100 p-12 border-1 min-w-full">B</swiper-slide>
  <swiper-slide class="bg-blue-200 p-12 border-1 min-w-full">C</swiper-slide>
  <swiper-slide class="bg-blue-300 p-12 border-1 min-w-full">D</swiper-slide>
  <swiper-slide class="bg-blue-400 p-12 border-1 min-w-full">A</swiper-slide>
</swiper-container>

Find the code for this page in the src/pages/components/carousel.mdx file.

Image Alt
6R0920870F
6R0.920.870.F
6R0-920-870-F
6R0 920 870 F
Image Alt
6R0920870F
6R0.920.870.F
6R0-920-870-F
6R0 920 870 F
Image Alt
6R0920870F
6R0.920.870.F
6R0-920-870-F
6R0 920 870 F
Image Alt
6R0920870F
6R0.920.870.F
6R0-920-870-F
6R0 920 870 F
Image Alt
6R0920870F
6R0.920.870.F
6R0-920-870-F
6R0 920 870 F
<div class="bg-white rounded-lg p-4 w-full">
  <swiper-container
    class="flex w-full max-w-full"
    grid-rows="1"
    mousewheel-force-to-axis="true"
    navigation="false"
    scrollbar="false"
    slides-per-view="auto"
    space-between="0"
  >
    <swiper-slide
      class="carousel-product-tile"
    >
      <ProductTile productObject={productObject} />
    </swiper-slide>
    ...
  </swiper-container>
</div>

Props

Both Carousel and ProductCarousel are zero-prop wrappers around <swiper-container>. They render a fixed demo set of slides — drop their markup into your own page and pass slides as children to customize.

Swiper Attributes

Configure behavior via attributes on <swiper-container>. The full list lives in the Swiper Element docs; the most useful ones are:

Attribute Type Description
slides-per-view number | 'auto' Number of visible slides (use auto for variable widths)
space-between number Gap between slides in pixels
navigation boolean Show prev/next arrows
pagination boolean Show pagination dots
pagination-type 'bullets' | 'fraction' | 'progressbar' Pagination style
scrollbar boolean Show draggable scrollbar
mousewheel-force-to-axis boolean Lock mousewheel to scroll axis
grid-rows number Number of slide rows in grid layout

CSS Shortcuts

Class Purpose
carousel-product-tile Slide width sizing for product tiles inside ProductCarousel