---
title: Examples
slug: wip/fxlC-examples
createdAt: 2025-07-07T17:17:46.136Z
---

# Examples

## Basic Usage

This basic example demonstrates how to use the Carousel to create a simple, scrollable story card carousel. It includes multiple slides with content overflow, default navigation, draggable slides, and skip link button, making it easy to showcase content in a compact, interactive format with minimal setup.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/OPyWvRd/f75df19559a1c232abe525dca037765d?default-tab=html%2Cresult&editable=true&theme-id=39967&#x22; height=&#x22;700px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Mixed Content

The carousel supports mixed content types and automatically adjusts each slide's height to maintain a consistent width and layout.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/zxvZbwq/12e0e168dc1211ff63415706b517d7e5?default-tab=html%2Cresult&theme-id=39967&#x22; height=&#x22;700px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Content-Based Slide Width

Each slide adapts its width based on its content, allowing for a more flexible and dynamic layout. Unlike fixed-width slides, this approach is ideal for displaying text blocks, cards, or mixed media elements of varying sizes.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/KwdaOoX/5d26b781d4dac7c0d5a1c6a88322c23a?default-tab=html%2Cresult&editable=true&theme-id=39967&#x22; height=&#x22;900px&#x22;loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Lightbox&#x20;

Centered layout displays one slide at a time with visible offsets of adjacent slides. This approach creates a focused viewing experience while hinting at additional content, encouraging interaction through subtle visual cues.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/azvpGdj/24242944729a01171119ce5526891316?default-tab=html%2Cresult&editable=true&theme-id=39967ditable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;750px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Contained Layout with defined Slides per View&#x20;

The carousel can set a number of slides to display simultaneously, offering a clean and structured layout. Navigation controls allow users to scroll through additional slides while maintaining a consistent per view format.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/xbwgWpP/213180c56f061ffa3261a3bfdd9e6719?default-tab=html%2Cresult&editable=true&theme-id=39967&#x22; height=&#x22;700px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Center-aligned with inifinite looping&#x20;

The carousel can be center-aligned and configured to loop infinitely, creating a smooth and uninterrupted browsing experience. For looping to function correctly, ensure that the number of slides is greater than the number of slides per view. Centering will not function correctly if `slidesToScroll` is greater than or equal to `slidesPerView`.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/VYvPxro/f2b0d95d7889eb9d092f167195bfbf2a?default-tab=html%2Cresult&editable=true&theme-id=39967&#x22; height=&#x22;700px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

***

## Event Debouncing &#x20;

The `eventsDebounce` property allows you to specify debounce delays (in milliseconds) for carousel events, reducing how often they are emitted during rapid user interactions or animations. This is useful for optimizing performance and preventing excessive event handling in your application.

The following events are controlled by `eventsDebounce`.

```typescript
export interface EventsDebounce {
  /** Default: 450 */
  containerviewchange?: number;
  /** Default: 450 */
  slidesinview?: number;
  /** Default: 0 */
  carouselprogress?: number;
  /** Default: 450 */
  slidechange?: number;
}
```

:::Iframe{iframeHeight="0" code="<iframe class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://cosmos-storybook.rbds-staging.redbullaws.com/storybook/iframe.html?id=media-carousel--events-debounce-demo&viewMode=story&#x22; height=&#x22;700px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

