Media
Carousel
A track of items with paging and optional rotation, which pauses on demand and while you point at or work in it.
WAI-ARIA tested
Import
main.ts
import { Carousel } from '@vitral/vue';Several at once
Circular, with rotation
Vertical
Transitions, one at a time
The default slides the whole strip, which is what lets a carousel show several at once. Every other preset shows one and animates it where it stands, so it applies only where numVisible is 1. They are the same presets Galleria uses.
API
Read from packages/vue/src/components/Carousel/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| value | any[] | — |
| numVisible | number | Items shown at once. Defaults to 1. |
| numScroll | number | Items moved per step. Defaults to 1. |
| responsiveOptions | CarouselResponsiveOption[] | Fewer items on smaller screens. |
| orientation | 'horizontal' | 'vertical' | — |
| verticalViewPortHeight | string | The viewport's height when vertical. Defaults to `'20rem'`. |
| circular | boolean | Wrap round: the last item is followed by the first. On by default — a gallery that stops dead at the end sends the reader back through everything they have just seen to reach the other end of it. |
| autoplayInterval | number | Milliseconds between automatic steps; 0 (the default) turns it off. |
| showNavigators | boolean | Defaults to true. |
| showIndicators | boolean | Defaults to true. |
| ariaLabel | string | Names the carousel. |
| transition | TransitionPreset | 'slide' | How one slide gives way to the next. The default `'slide'` moves the whole strip, which is what lets a carousel show several at once; every other preset shows one at a time and animates it in place, so it applies only where `numVisible` is 1. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| update:page | page: number | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| item | (props: { data: unknown; index: number }) | — |
| header | — | — |
| footer | — | — |
| empty | — | — |