An image carousel component combining images with navigation arrows and pagination dots for hero banners and product galleries.
Loading demo: carouselimage-real-world
npx sdaia-ui@latest add carouseimage
import { CarouselImage } from '@/components/ui/CarouselImage';<CarouselImage images={images} />;The default carousel with dot navigation indicators.
Loading demo: carousel-image-default
Carousel with autoplay logic.
Loading demo: carousel-image-autoplay
Carousel with navigation arrows.
Loading demo: carousel-image-subtle-arrows
Props for the CarouselImage component.
Prop | Type | Default | Required |
|---|---|---|---|
images | CarouselImageItem[] | - | required |
activeIndex | number | - | optional |
defaultIndex | number | 0 | optional |
onChange | (index: number) => void | - | optional |
loop | boolean | true | optional |
autoplayMs | number | - | optional |
showArrows | boolean | true | optional |
showDots | boolean | true | optional |
size | 'sm' | 'md' | 'full' | 'md' | optional |
aspectRatio | string | matches `size` (12 / 7 for sm / md, 16 / 9 for full) | optional |
height | string | - | optional |
arrowVariant | 'brand' | 'neutral' | 'subtle' | 'outline' | 'on-color' | 'brand' | optional |
arrowSize | 'sm' | 'md' | 'lg' | 'md' | optional |
dotsVariant | 'brand' | 'neutral' | 'on-color' | 'brand' | optional |
dotsSize | 'sm' | 'md' | 'lg' | 'sm' | optional |
radiusClassName | string | 'rounded-[var(--ds-radius-m)]' | optional |
ariaLabel | string | 'Image carousel' | optional |
overlay | boolean | true | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Fills its container up to 418px (size md, default) or 360px (sm), at a fixed height; size full fills the container at 16:9. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | The width shrinks with the screen while sm and md keep their fixed height. Use size full for an image that keeps its 16:9 ratio. Slides change with the arrows and dots; there is no swipe. |