Products · Components

Carousel

Slides the person swipes between, one at a time, with dots below.

Put one child in it for each slide, such as an Image or a card.

Children: Components

Example

The Carousel component
view.dml
<Carousel indicator="dots" gap="small">
  <Image src="statics/photo.jpg" alt="First slide" aspect="16:9" fit="cover" shape="rounded" />
  <Image src="statics/photo.jpg" alt="Second slide" aspect="16:9" fit="cover" shape="rounded" />
</Carousel>

Props

PropTypeWhat it is
autoplaybooleanMoves to the next slide every interval milliseconds, pausing while touched. Default: false.
intervalnumberIn milliseconds. Default: 4000.
loopbooleanAfter the last slide comes the first again. Default: false.
indicatordots, noneDefault: dots.
gapspacingSpace between slides, seen while one slides in. Default: none.
effectslide, scalescale shrinks a slide as it leaves the middle and grows the one coming in, as you swipe. Default: slide.
indexnumberThe slide to show. Changing it moves the carousel there.
padding, paddingTop, paddingStart, paddingEnd, paddingBottomspacingSpace inside its edges, all round or on one side.

Events

EventSendsNotes
onChange{ index } in detailThe slide now showing.

Keep reading

On this page