This is the first slide of the carousel.
Carousel
Displays multiple items in a sliding gallery.
---
import Heading from "@core-elements/heading/Heading.astro";
import Text from "@core-elements/text/Text.astro";
import Carousel from "@wrappers/carousel/Carousel.astro";
import CarouselSlide from "@wrappers/carousel/CarouselSlide.astro";
---
<Carousel label="" minSlideWidth={0} slideWidthPercent={100}>
<CarouselSlide>
<Heading alignX="center" level="h2">
Slide 1
</Heading>
<Text alignX="center">
<p>This is the first slide of the carousel.</p>
</Text>
</CarouselSlide>
<CarouselSlide>
<Heading alignX="center" level="h2">
Slide 2
</Heading>
<Text alignX="center">
<p>This is the second slide of the carousel.</p>
</Text>
</CarouselSlide>
<CarouselSlide>
<Heading alignX="center" level="h2">
Slide 3
</Heading>
<Text alignX="center">
<p>This is the third slide of the carousel.</p>
</Text>
</CarouselSlide>
</Carousel> ---
blocks:
_component: building-blocks/wrappers/carousel
slides:
- contentSections:
- _component: building-blocks/core-elements/heading
text: Slide 1
level: h2
alignX: center
- _component: building-blocks/core-elements/text
alignX: center
text: This is the first slide of the carousel.
- contentSections:
- _component: building-blocks/core-elements/heading
text: Slide 2
level: h2
alignX: center
- _component: building-blocks/core-elements/text
text: This is the second slide of the carousel.
alignX: center
- contentSections:
- _component: building-blocks/core-elements/heading
text: Slide 3
level: h2
alignX: center
- _component: building-blocks/core-elements/text
text: This is the third slide of the carousel.
alignX: center
label: ''
autoPlay: false
autoScroll: false
slideWidthPercent: 100
minSlideWidth: 0
--- Overview
A carousel for displaying multiple slides of content. Supports autoplay and auto-scroll options, with configurable slide widths and minimum sizes to maintain responsive layouts.
Properties
label string
slides string | default: array
autoPlay string | default: false
autoScroll string | default: false
loop string | default: true
showIndicators string | default: true
showArrows string | default: true
align string | default: center
slidesToScroll string | default: auto
slideWidthPercent string | default: 100
minSlideWidth string | default: 0
Slots
default
The contents for the the Carousel.
Used only when the slides property is not set.
Child Component:
<CarouselSlide>
Properties (documented under the
slides property
above):
-
contentSections/slot
Examples
Auto play
---
import Image from "@core-elements/image/Image.astro";
import Carousel from "@wrappers/carousel/Carousel.astro";
import CarouselSlide from "@wrappers/carousel/CarouselSlide.astro";
---
<Carousel autoPlay>
<CarouselSlide>
<Image alt="Quiet Street" source="/src/assets/images/component-docs/quiet-street.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Sunset" source="/src/assets/images/component-docs/sunset.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Sheep" source="/src/assets/images/component-docs/sheep.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Castle" source="/src/assets/images/component-docs/castle.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Dunedin Cliff" source="/src/assets/images/component-docs/dunedin-cliff.jpg" />
</CarouselSlide>
</Carousel> ---
blocks:
_component: building-blocks/wrappers/carousel
autoPlay: true
slides:
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/quiet-street.jpg
alt: Quiet Street
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sunset.jpg
alt: Sunset
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sheep.jpg
alt: Sheep
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/castle.jpg
alt: Castle
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/dunedin-cliff.jpg
alt: Dunedin Cliff
--- Auto scroll
---
import Image from "@core-elements/image/Image.astro";
import Carousel from "@wrappers/carousel/Carousel.astro";
import CarouselSlide from "@wrappers/carousel/CarouselSlide.astro";
---
<Carousel autoScroll>
<CarouselSlide>
<Image alt="Quiet Street" source="/src/assets/images/component-docs/quiet-street.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Sunset" source="/src/assets/images/component-docs/sunset.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Sheep" source="/src/assets/images/component-docs/sheep.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Castle" source="/src/assets/images/component-docs/castle.jpg" />
</CarouselSlide>
<CarouselSlide>
<Image alt="Dunedin Cliff" source="/src/assets/images/component-docs/dunedin-cliff.jpg" />
</CarouselSlide>
</Carousel> ---
blocks:
_component: building-blocks/wrappers/carousel
autoScroll: true
slides:
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/quiet-street.jpg
alt: Quiet Street
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sunset.jpg
alt: Sunset
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sheep.jpg
alt: Sheep
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/castle.jpg
alt: Castle
- contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/dunedin-cliff.jpg
alt: Dunedin Cliff
--- Width percentage
---
import Image from "@core-elements/image/Image.astro";
import Card from "@wrappers/card/Card.astro";
import Carousel from "@wrappers/carousel/Carousel.astro";
import CarouselSlide from "@wrappers/carousel/CarouselSlide.astro";
---
<Carousel minSlideWidth={200} slideWidthPercent={33}>
<CarouselSlide>
<Card paddingHorizontal="xs" paddingVertical="none">
<Image alt="Quiet Street" source="/src/assets/images/component-docs/quiet-street.jpg" />
</Card>
</CarouselSlide>
<CarouselSlide>
<Card paddingHorizontal="xs" paddingVertical="none">
<Image alt="Sunset" source="/src/assets/images/component-docs/sunset.jpg" />
</Card>
</CarouselSlide>
<CarouselSlide>
<Card paddingHorizontal="xs" paddingVertical="none">
<Image alt="Sheep" source="/src/assets/images/component-docs/sheep.jpg" />
</Card>
</CarouselSlide>
<CarouselSlide>
<Card paddingHorizontal="xs" paddingVertical="none">
<Image alt="Castle" source="/src/assets/images/component-docs/castle.jpg" />
</Card>
</CarouselSlide>
<CarouselSlide>
<Card paddingHorizontal="xs" paddingVertical="none">
<Image alt="Dunedin Cliff" source="/src/assets/images/component-docs/dunedin-cliff.jpg" />
</Card>
</CarouselSlide>
</Carousel> ---
blocks:
_component: building-blocks/wrappers/carousel
slideWidthPercent: 33
minSlideWidth: 200
slides:
- contentSections:
- _component: building-blocks/wrappers/card
paddingHorizontal: xs
paddingVertical: none
contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/quiet-street.jpg
alt: Quiet Street
- contentSections:
- _component: building-blocks/wrappers/card
paddingHorizontal: xs
paddingVertical: none
contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sunset.jpg
alt: Sunset
- contentSections:
- _component: building-blocks/wrappers/card
paddingHorizontal: xs
paddingVertical: none
contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/sheep.jpg
alt: Sheep
- contentSections:
- _component: building-blocks/wrappers/card
paddingHorizontal: xs
paddingVertical: none
contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/castle.jpg
alt: Castle
- contentSections:
- _component: building-blocks/wrappers/card
paddingHorizontal: xs
paddingVertical: none
contentSections:
- _component: building-blocks/core-elements/image
source: /src/assets/images/component-docs/dunedin-cliff.jpg
alt: Dunedin Cliff
---