logo-icon
STWUI

Carousel

Wild Landscape
Camera
Exotic Fruits

svelte
<script lang="ts">
	import { Carousel } from 'stwui';
	import type { CarouselSlide } from 'stwui/types';

	const slides: CarouselSlide[] = [
		{
			id: '1',
			src: 'https://mdbcdn.b-cdn.net/img/new/slides/041.webp',
			alt: 'Wild Landscape'
		},
		{
			id: '2',
			src: 'https://mdbcdn.b-cdn.net/img/new/slides/042.webp',
			alt: 'Camera'
		},
		{
			id: '3',
			src: 'https://mdbcdn.b-cdn.net/img/new/slides/043.webp',
			alt: 'Exotic Fruits'
		}
	];
</script>

<div class="h-[36rem]">
	<Carousel {slides} />
</div>

Carousel Props

slides CarouselSlide[] []
activeSlide number 0
rotation number 0