Skip to content

Navigation Component

The Navigation component provides intuitive Previous and Next buttons for slide navigation, with support for custom styling and RTL layouts.

Basic Usage

vue
<script setup>
import { Navigation as CarouselNavigation } from 'vue3-carousel'
</script>

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

Features

  • Automatic RTL support
  • Vertical navigation support
  • Customizable button appearance
  • Automatic disable state when reaching bounds
  • Built-in accessibility features

Custom Navigation Buttons

You can customize the navigation buttons using slots:

vue
<template>
  <Carousel>
    <Slide v-for="slide in 10" :key="slide">
      <!-- slide content -->
    </Slide>
    
    <template #addons>
      <CarouselNavigation>
        <template #prev>
          <span>←</span>
        </template>
        <template #next>
          <span>→</span>
        </template>
      </CarouselNavigation>
    </template>
  </Carousel>
</template>

Styling

CSS Custom Properties

VariableDefault ValueDescription
--vc-nav-backgroundtransparentNavigation button background
--vc-nav-border-radius0Navigation button border radius
--vc-nav-colorvar(--vc-clr-primary)Navigation button color
--vc-nav-color-hovervar(--vc-clr-secondary)Navigation button hover color
--vc-nav-height30pxNavigation button height
--vc-nav-width30pxNavigation button width

Accessibility

  • Buttons include descriptive ARIA labels
  • Automatic disable state management
  • Keyboard navigation support
  • Proper focus management

Released under the MIT License.