Cycle Component

The ds-cycle component allows cycling through content items with automatic or manual transitions.

<ds-cycle>
<div>Slide 1</div>
<div>Slide 2</div>
<div>Slide 3</div>
</ds-cycle>

Enable auto-play with a specified interval:

<ds-cycle auto interval="3000">
<div>First item</div>
<div>Second item</div>
<div>Third item</div>
</ds-cycle>
<ds-cycle id="myCycle">
<div>Item A</div>
<div>Item B</div>
<div>Item C</div>
</ds-cycle>
<script>
const cycle = document.getElementById('myCycle');
// Navigate programmatically
cycle.next();
cycle.previous();
cycle.goTo(2);
</script>
AttributeTypeDefaultDescription
autobooleanfalseEnable automatic cycling
intervalnumber5000Interval between transitions (ms)
loopbooleantrueLoop back to start after last item
MethodDescription
next()Go to the next item
previous()Go to the previous item
goTo(n)Go to a specific item by index
EventDescription
changeFired when the active item changes