# TallStackUI: Carousel
> TallStackUI is a TALL Stack (Tailwind CSS, Alpine.js, Laravel, Livewire)
> component library providing 80+ Blade components for building modern web interfaces.
An image carousel/slider component with manual navigation or autoplay, optional indicators, looping, shuffle, rounded corners, an opt-in thumbnail strip below the slides, an opt-in lightbox that expands the active image fullscreen, and support for image titles, descriptions, URLs, and custom header/footer slots.
## Basic Usage
```blade
```
```blade
```
```blade
Gallery
```
## Attributes
| Attribute | Type | Default | Description |
|-------------------|-------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| images | Collection\|array\|null | null | Array of image objects (required). Each must have `src` and `alt`. Optional: `title`, `description`, `url`, `target`, `cover`. |
| cover | int\|null | null | 1-based index of the initial slide; or set `cover: true` on an image entry |
| autoplay | bool | null | Enables automatic slide advancement |
| interval | int\|null | 3 | Autoplay interval in seconds |
| withoutLoop | bool | null | Disables looping back to the first slide after the last |
| withoutIndicators | bool | null | Hides the bottom dot indicators |
| stopOnHover | bool | null | Pauses autoplay when the mouse hovers over the image |
| round | bool\|string | null | Applies rounded corners to images and overlay. As a flag it applies `rounded-xl`; as a string it accepts `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl` or `full` (`rounded-{suffix}`). Any other value throws. |
| shuffle | bool | null | Randomizes the image order on initialization |
| clickable | bool | null | Renders each slide as a button that opens the image in a fullscreen lightbox (overlay teleported to the body, closes on the X button, ESC, or click outside the image). When enabled, `url`/`target` on image entries are ignored. |
| navigable | bool | null | Adds prev/next arrow buttons and `←`/`→` keyboard shortcuts inside the lightbox so the user can step through every image without closing it. Requires `clickable`. Looping mirrors the carousel's own `withoutLoop` behavior — by default it wraps; with `withoutLoop` the buttons become disabled at the edges. |
| thumbnails | bool\|null | null | Renders a left-aligned row of small square thumbnail tiles below the slides (between the slides and the `footer` slot). Clicking a tile jumps to that slide; the tile of the current slide is highlighted. Implies `withoutIndicators`. Falls back to the `thumbnails` configuration key (default `false`). |
| limit | int\|null | null | Maximum number of thumbnail tiles. When the carousel holds more images than `limit`, the last tile becomes a muted `+N` tile counting every image from its own position onwards (`N = count($images) - $limit + 1`). Requires `thumbnails` and must be at least 2. Falls back to the `limit` configuration key (default `6`). |
| withoutHighlight | bool\|null | null | Renders every thumbnail tile with the inactive look, dropping the primary ring from the tile of the current slide. `aria-current` is still set. Requires `thumbnails`. |
| caption | string\|null | null | Renders the expanded image's `title` and `description` inside the lightbox. Accepts `overlay` (caption sits on top of the image, anchored to its bottom edge with a fade gradient) or `footer` (caption sits below the image on a separate row). Requires `clickable`. When the expanded image carries no title or description, the figcaption is skipped. |
| wrapper | string\|null | null | Custom CSS class for the slide container height (overrides default `min-h-[50svh]`) |
| header | ComponentSlot\|null | null | Header slot content displayed above the carousel |
| footer | ComponentSlot\|null | null | Footer slot content displayed below the carousel |
## Image Object Structure
| Key | Type | Required | Description |
|-------------|--------|----------|---------------------------------------------|
| src | string | Yes | Image source URL |
| alt | string | Yes | Alt text for accessibility |
| title | string | No | Overlay title text |
| description | string | No | Overlay description text below the title |
| url | string | No | Makes the slide a clickable link |
| target | string | No | Link target (e.g., `_blank`) |
| cover | bool | No | Marks this image as the initial cover slide |
## Slots
| Slot | Description |
|--------|-------------------------------------|
| header | Content rendered above the carousel |
| footer | Content rendered below the carousel |
## Validation Constraints
- The `images` attribute is required and cannot be empty.
- The `caption` must be either `overlay` or `footer`.
- The `caption` requires `clickable` to be enabled.
- The `navigable` requires `clickable` to be enabled.
- The `limit` can only be used along with `thumbnails`.
- The `limit` must be at least 2.
- The `without-highlight` can only be used along with `thumbnails`.
- The `round` must be a boolean or one of `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `full`.
## Autoplay
```blade
```
The timer stops when the carousel leaves the page, through a Livewire re-render or a `wire:navigate` visit.
A slide change does not close the floating popups on the page. The slides only hold
images and the `header` and `footer` slots stay in place, so a dropdown placed in one of
them, or a select and a date picker elsewhere on the page, stay open while the autoplay
runs.
## Cover Image
Set a specific image as the initial cover:
```blade
```
## Thumbnails
Add `thumbnails` to render a left-aligned row of small square tiles below the slides, the usual product-page arrangement, so the user sees at a glance that the carousel holds more images and can jump to any of them.
```blade
```
```blade
```
```blade
Click a thumbnail to jump to that photo.
```
- Tiles are fixed-size squares (`h-16 w-16`, `h-20 w-20` from `sm`) separated by `gap-3`; the row never stretches to fill the width.
- Clicking a tile moves the carousel to that slide and restarts the autoplay timer, exactly like the dot indicators.
- The tile of the current slide carries a 2px primary ring and `aria-current="true"`; the other tiles carry a subtle gray ring.
- Add `without-highlight` to drop the primary ring, so every tile shares the inactive look while `aria-current` keeps marking the current slide for assistive technology.
```blade
```
- `thumbnails` implies `withoutIndicators`: the strip already shows the position, so the bottom dots are hidden.
- `limit` caps the number of tiles (default `6`). When the carousel holds more images than `limit`, the last tile becomes a muted `+N` tile counting every image without a tile of its own, itself included (`N = count($images) - $limit + 1`). Clicking it moves to the image under it (the `limit`-th image), and the arrows keep going from there. While the current slide sits beyond the visible tiles, the `+N` tile keeps the highlight.
- When the carousel holds `limit` images or fewer, the strip simply renders one tile per image and no `+N` tile appears.
- The strip renders from the same Alpine state the slides use, so it follows the `shuffle` order and never drifts from the slides.
- `round` applies to the tiles the same way it applies to the slides.
- Tiles are `