This component requires internationalisation (i18n) to be set up in your application.
AdaptiveCarousel is only available in the React API for SWAN.
This component is intended to replace Carousel and Thumbnails Hero.
This component requires internationalisation (i18n) to be set up in your application.
AdaptiveCarousel is only available in the React API for SWAN.
This component is intended to replace Carousel and Thumbnails Hero.
The preview has been updated.
Carousel slides are empty, flexible containers that can hold any content. Most commonly, this is promotional content using Standard Tiles or components created from Base Tile, but it can also include Cards, Buttons, images, and videos.
Adaptive Carousel does not clip or mask slide content. This enables slides to support a wide variety of layouts without clipping interactive elements or visual effects. When rounded corners are required, they should be applied by the slide content itself rather than the carousel container.
Nesting an Adaptive Carousel inside another is not recommended.
Use slidesToShow to define how many slides are visible. You can set different values for Responsive System breakpoints, for example {{ xs: 2, md: 6 }}. Decimal values are not supported and will be rounded down.
The preview has been updated.
The preview has been updated.
Use alignSelf to adjust a slide’s vertical alignment. Use alignSelf="stretch" to make a slide fill the Carousel’s height, or alignSelf="center" to center it vertically." When using Standard Tile, combine this with StandardTileFooter. When using components created using Base Tile, combine this with the evenHeight prop.
The preview has been updated.
Use initialSlide to specify which slide is shown first when the Adaptive Carousel initially renders. The value represents the slide number (for example, 1 shows the first slide, 2 shows the second).
This prop is applied only on initial render and does not update the active slide after the component mounts.
The preview has been updated.
Controls adapt to the carousel size. By default, Slide Navigation Buttons are visible. When the component is narrower than 480px, Slide Picker dots appear, and Slide Navigation buttons show only on hover.
The preview has been updated.
Slide Navigation Buttons automatically align vertically to the center of images when slides use Standard Tile or Tiles created from Base Tile. Otherwise, they align vertically to the center of the slide height.
The preview has been updated.
Use slidePicker with AdaptiveCarouselSlidePickerThumbnails to add Slide Picker Thumbnails. Use AdaptiveCarouselSlidePickerThumbnail to contain each thumbnail image. Use video to indicate that a slide contains video content.
This is recommended only when slidesToShow={1}.
The preview has been updated.
Use onSlideChange to run side effects when the active slide changes, such as tracking metrics. The callback will return two parameters that represent the first and last slides, respectively, in the currently visible range after the change. This is debounced to prevent firing more than once every ~200ms.
The preview has been updated.
Use AdaptiveCarouselImage when the slide content is an image.
The preview has been updated.
Use aspectRatio set the image’s aspect ratio. Passing an aspect ratio will also reserve space for the image while loading, preventing a layout shift.
The preview has been updated.
Use objectFit to control how the image fills its container and objectPosition to set the image’s position within the container.
The preview has been updated.
<section>.| prop | type | required | default |
|---|---|---|---|
aria-labelDefines a string value that labels the current element.
@see aria-labelledby. | string | false | null |
aria-labelledbyIdentifies the element (or elements) that labels the current element.
@see aria-describedby. | string | false | null |
onSlideChangeCallback when the active slide changes for executing side effects, such as metrics.
Uses 1-based indexing (first slide = 1, second slide = 2, etc.) | ((firstSlide: number, lastSlide: number) => void) | false | null |
slidePickerAccepts an AdaptiveCarouselSlidePickerThumbnails containing an equal amount of thumbnails for slides. | ReactNode | false | 'standard' |
slidesToShowRounded down to nearest whole number.
Default value depends on what other props are passed. | Responsive<number> | false | null |
initialSlideThe slide number to display as the first visible slide when the carousel loads.
Uses 1-based indexing (first slide = 1, second slide = 2, etc.) | number | false | 1 |
skin`promo-bar` skin should only be used by the Merchandising Components team, controlled via Contentful. | "standard""promo-bar" | false | 'standard' |
<img>.| prop | type | required | default |
|---|---|---|---|
alt | string | false | '' |
aspectRatio | AspectRatio | false | null |
objectFit | ObjectFit | false | null |
objectPosition | ObjectPosition<0(string & {})> | false | null |
<div>.| prop | type | required | default |
|---|---|---|---|
activeShould be passed internally | boolean | false | null |
alignSelfOverrides the flex item's `align-items` value on an individual slide basis. | AlignSelf | false | 'start' |
<button>.| prop | type | required | default |
|---|---|---|---|
indexShould be passed internally | number | false | null |
videoShould be set to `true` if the thumbnail represents a video | boolean | false | null |
| Component | Renders | Notes |
|---|---|---|
AdaptiveCarouselSlidePickerThumbnails | <div> |
SWAN's Internationalization System allows SWAN components to render with fully translated and accessible text out-of-the-box. The following keys are provided to allow you to override the default translation.
| Default Text | Key |
|---|---|
slide Accessible description for a single item in a Carousel component, used for aria-roledescription, i.e. a Carousel slide | adaptive-carousel-slide.aria-roledescription |
Go to slide {{slideNumber}} | adaptive-carousel-slide-picker-internal.accessible-text-for-button |
Go to slide {{slideNumber}} | adaptive-carousel-slide-picker-thumbnail.accessible-text-for-button |
Go to next slide | adaptive-carousel-slide-navigation-internal.accessible-text-for-next-button |
Go to previous slide | adaptive-carousel-slide-navigation-internal.accessible-text-for-previous-button |
{{current}} of {{totalSlides}} | adaptive-carousel.accessible-text-for-slide |
Slide {{start}} of {{totalSlides}} | adaptive-carousel.accessible-text-for-visible-slides_one |
Slides {{start}} to {{end}} of {{totalSlides}} | adaptive-carousel.accessible-text-for-visible-slides_other |
carousel Accessible description for a Carousel component, used for aria-roledescription | adaptive-carousel.aria-roledescription |