--- // Self-contained carousel (.carousel). Default slot holds the .carousel-item elements // (the caller marks the first one "active" — see CarouselCard.astro / hero/Side.astro); // indicators/controls are generated from props. A "controls" slot overrides the default // icon-span controls with custom markup (e.g. an -based pair). interface Props { id?: string /** slide count, used to generate indicator buttons */ slideCount: number fade?: boolean /** data-bs-interval in ms, or false to disable autoplay */ interval?: number | false indicators?: boolean indicatorsVariant?: 'dot' | 'thumb' indicatorsVertical?: boolean /** ratio ratio-4x3 on each indicator button, typically paired with indicatorsVariant="thumb" */ indicatorsThumbRatio?: boolean /** background-image per slide, used when indicatorsVariant="thumb" */ indicatorsImages?: string[] controls?: boolean class?: string /** remaining attributes forwarded to the element */ [key: string]: unknown } const { id, slideCount, fade, interval, indicators, indicatorsVariant, indicatorsVertical, indicatorsThumbRatio, indicatorsImages, controls, class: className, ...rest } = Astro.props const target = id ? `#${id}` : undefined const slideIndexes = Array.from({ length: slideCount }, (_, i) => i) const hasCustomControls = Astro.slots.has('controls') ---
{ indicators && (
{slideIndexes.map((i) => (
) } { hasCustomControls ? ( ) : ( controls && ( ) ) }