mirror of
https://github.com/tabler/tabler.git
synced 2026-08-29 13:21:29 +04:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
27 lines
875 B
Plaintext
27 lines
875 B
Plaintext
---
|
|
// Self-contained carousel (.carousel). Default slot holds the .carousel-item elements
|
|
// (the caller marks the first one "active" — see CarouselCard.astro / hero/Side.astro);
|
|
// a "controls" slot renders custom prev/next markup (e.g. an <Icon>-based pair).
|
|
|
|
interface Props {
|
|
id?: string
|
|
/** data-bs-interval in ms, or false to disable autoplay */
|
|
interval?: number | false
|
|
class?: string
|
|
/** remaining attributes forwarded to the element */
|
|
[key: string]: unknown
|
|
}
|
|
|
|
const { id, interval, class: className, ...rest } = Astro.props
|
|
|
|
const hasCustomControls = Astro.slots.has('controls')
|
|
---
|
|
|
|
<div id={id} class:list={['carousel', 'slide', className]} data-bs-ride="carousel" data-bs-interval={interval === false ? 'false' : interval} {...rest}>
|
|
<div class="carousel-inner">
|
|
<slot />
|
|
</div>
|
|
|
|
{hasCustomControls && <slot name="controls" />}
|
|
</div>
|