---
title: "Cover Flow"
description: "Slides that tilt and fan out in a cover-flow effect."
canonical_url: "https://www.blossom-carousel.com/docs/examples/advanced/cover-flow"
---

> Index of every page on this site: [llms.txt](https://www.blossom-carousel.com/llms.txt)

<supports-view-timeline-support>
<caution>

View-timeline is not yet supported in this browser. Check browser compatibility at [caniuse.com](https://caniuse.com/?search=scroll-snap-change)

</caution>
</supports-view-timeline-support>

<example-cover-flow>



</example-cover-flow>

<tabs sync="example-code-style">
<tabs-item label="CSS">
<code-group>

```css [.css]
.carousel {
  padding-inline: calc(50% - 50px);
  scroll-snap-type: x mandatory;
}

ul {
  white-space: nowrap;
  transform-style: preserve-3d;
}

li {
  display: inline-block;
  position: relative;
  width: 100px;
  aspect-ratio: 1 / 2;
  transform-style: preserve-3d;
  scroll-snap-align: center;

  view-timeline: --slide inline calc(50% - 140px);
}

.slide {
  perspective: 500px;
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  aspect-ratio: 1;
  transform-style: preserve-3d;

  animation: linear slide-cover both;
  animation-timeline: --slide;
  animation-range: contain;
}

.card {
  width: 100%;
  height: 100%;

  animation: linear rotate-cover both;
  animation-timeline: --slide;
  animation-range: contain;
}

@keyframes rotate-cover {
  0% {
    transform: rotateY(-55deg);
  }
  50% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(55deg);
  }
}

@keyframes slide-cover {
  0% {
    transform: translateX(30%);
  }
  50% {
    transform: translateX(0) scale(1.2);
  }
  100% {
    transform: translateX(-30%);
  }
}
```

```html [.html]
<BlossomCarousel class="carousel">
  <ul>
    <li>
      <div class="slide">
        <div class="card"></div>
      </div>
    </li>
    <li>
      <div class="slide">
        <div class="card"></div>
      </div>
    </li>
    ...
  </ul>
</BlossomCarousel>
```

</code-group>
</tabs-item>

<tabs-item label="Tailwind">
<code-group>

```css [.css]
li {
  view-timeline: --slide inline calc(50% - 140px);
}

.slide {
  animation: linear slide-cover both;
  animation-timeline: --slide;
  animation-range: contain;
}

.card {
  animation: linear rotate-cover both;
  animation-timeline: --slide;
  animation-range: contain;
}

@keyframes rotate-cover {
  0% {
    transform: rotateY(-55deg);
  }
  50% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(55deg);
  }
}

@keyframes slide-cover {
  0% {
    transform: translateX(30%);
  }
  50% {
    transform: translateX(0) scale(1.2);
  }
  100% {
    transform: translateX(-30%);
  }
}
```

```html [.html]
<BlossomCarousel class="py-24 snap-x snap-mandatory px-[calc(50%-50px)]!">
  <ul class="whitespace-nowrap! transform-3d">
    <li
      v-for="i in 12"
      :key="i"
      class="inline-block! relative transform-3d snap-center w-[100px] aspect-1/2 even:*:*:bg-primary-400"
    >
      <div
        class="perspective-normal slide absolute transform-3d top-0 -left-1/2 aspect-square w-[200%]"
      >
        <div
          class="card bg-primary rounded-lg flex items-center justify-center text-2xl font-bold text-white size-full"
        >
          {{ i }}
        </div>
      </div>
    </li>
  </ul>
</BlossomCarousel>
```

</code-group>
</tabs-item>
</tabs>

## Sitemap

See the full [sitemap](https://www.blossom-carousel.com/sitemap.md) for all pages.
