# <carousel>

Swipeable pages side by side, one at a time, with dots below that show which page is on screen.

Category: Display. Also written `<swiper>`, `<page-view>`.

```ham
<carousel height="240">
    <img src="https://hypeapps.dev/gallery/assets/landscape.jpg"
         style="w-full h-240 rounded-xl"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/city.jpg"
         style="w-full h-240 rounded-xl"
         fit="cover"/>
    <img src="https://hypeapps.dev/gallery/assets/dish.jpg"
         style="w-full h-240 rounded-xl"
         fit="cover"/>
</carousel>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/carousel-light.webp), [dark](https://hypeapps.dev/img/tags/carousel-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `height` | Carousel height in pixels | `200` |
| `initial-page` | Starting page index | `0` |
| `show-indicators` | Show page indicator dots | `true` |

## Readings

| Name | What it does |
|---|---|
| `index` | The page shown, from 0. |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<img>`](https://hypeapps.dev/docs/reference/img.md): Shows a picture from a URL or the app's files, sized and cropped by its style.
- [`<ad>`](https://hypeapps.dev/docs/reference/ad.md): An ad slot in the page, filled with a banner from AdMob in a built app.
- [`<avatar>`](https://hypeapps.dev/docs/reference/avatar.md): A round avatar from a photo, initials or an icon, in any size and color.
- [`<badge>`](https://hypeapps.dev/docs/reference/badge.md): A small count or dot pinned to the corner of an icon or any other element.
- [`<canvas-tool>`](https://hypeapps.dev/docs/reference/canvas-tool.md): A drawing tool written in HAM and loaded into a draw pad as a plugin: touch handlers, state and options.
- [`<caption>`](https://hypeapps.dev/docs/reference/caption.md): A table caption, shown as a label above the table.
- [`<chart>`](https://hypeapps.dev/docs/reference/chart.md): A line, area, bar or sparkline chart drawn from a list of values; a tap shows a point's value.
- [`<countdown>`](https://hypeapps.dev/docs/reference/countdown.md): A timer that counts down to zero in a format you choose and can act when it gets there.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
