Skip to content

Pagination Component

The Pagination component provides interactive indicators that allow users to navigate directly to specific slides.

Basic Usage

vue
<script setup>
import { Pagination as CarouselPagination } from 'vue3-carousel'
</script>

<template>
  <Carousel>
    <Slide v-for="slide in 10" :key="slide">
      <!-- slide content -->
    </Slide>
    
    <template #addons>
      <CarouselPagination />
    </template>
  </Carousel>
</template>

Props

PropTypeDefaultDescription
disableOnClickBooleanfalseWhen true, disables navigation when clicking pagination buttons
paginateByItemsToShowBooleanfalseGroups slides into pages based on itemsToShow setting

Styling

CSS Custom Properties

VariableDefault ValueDescription
--vc-pgn-active-colorvar(--vc-clr-primary)Active pagination button color
--vc-pgn-background-colorvar(--vc-clr-secondary)Pagination button background color
--vc-pgn-border-radius0Pagination button border radius
--vc-pgn-height4pxPagination button height
--vc-pgn-margin6px 5pxPagination button margin
--vc-pgn-width16pxPagination button width

Accessibility

  • Pagination buttons are properly labeled for screen readers
  • Active state is communicated through ARIA attributes
  • Buttons include descriptive titles for better UX

Released under the MIT License.