Skip to content

Configuration

Module Options

Configure the module in your nuxt.config.ts under the hero key:

ts
export default defineNuxtConfig({
  hero: {
    // Component name prefix (e.g., <HeroSlider>, <HeroPagination>)
    prefix: 'Hero',

    // Enable @nuxtjs/color-mode integration for dark mode support
    colorMode: true,

    // Enable @nuxt/icon for built-in navigation/control icons
    icon: true,

    // Default volume for video backgrounds (0 = muted, 1 = full)
    defaultVolume: 0,

    // Feature flags — opt-in to Swiper modules and capabilities
    features: {
      // Swiper modules
      navigation: true,     // Navigation arrows
      pagination: true,     // Pagination dots
      mousewheel: false,    // Mousewheel control
      keyboard: false,      // Keyboard navigation
      a11y: false,          // Accessibility module
      freeMode: false,      // Free-scroll mode
      thumbs: false,        // Thumbnails
      grid: false,          // Grid layout
      zoom: false,          // Pinch-to-zoom
      scrollbar: false,     // Scrollbar
      controller: false,    // Multi-slider sync
      virtual: false,       // Virtual slides
      hashNavigation: false,// Hash-based slide linking
      history: false,       // Browser history integration
      swiperParallax: false,// Swiper's built-in parallax

      // Slide effects (array — include only what you use)
      effects: ['fade', 'cube', 'coverflow', 'creative', 'cards', 'flip'],

      // Media features
      parallax: true,       // GSAP ScrollTrigger parallax
      video: true,          // Video backgrounds + controls
      hls: false,           // HLS streaming (requires video: true)
    },
  },
})

Feature Flags

Feature flags control which Swiper modules and CSS are bundled. Only enabled features are included in your production bundle — keeping it lean.

FlagSwiper ModuleCSS LoadedNotes
navigationNavigationswiper/css/navigationPrev/next arrows
paginationPaginationswiper/css/paginationDot indicators
mousewheelMousewheelScroll to change slides
keyboardKeyboardArrow key navigation
a11yA11yScreen reader support
freeModeFreeModeswiper/css/free-modeFree-scroll without snapping
thumbsThumbsswiper/css/thumbsThumbnail gallery
gridGridswiper/css/gridMulti-row grid layout
zoomZoomswiper/css/zoomPinch/double-tap zoom
scrollbarScrollbarswiper/css/scrollbarScrollbar indicator
controllerControllerSync multiple sliders
virtualVirtualswiper/css/virtualVirtual slides for large lists
hashNavigationHashNavigationURL hash linking
historyHistoryBrowser history
swiperParallaxParallaxSwiper's transition parallax

Slide Effects

Enable effects via the effects array. Each effect registers its Swiper module and CSS:

EffectDescription
fadeCrossfade between slides
cube3D cube rotation (best with exactly 4 slides)
coverflow3D coverflow carousel
creativeCustom CSS transform transitions
cardsStacked cards with depth
flip3D flip transition
ts
// Only bundle fade and creative effects
hero: {
  features: {
    effects: ['fade', 'creative'],
  },
}

Auto-Enabled Dependencies

  • Setting hls: true automatically enables video: true
  • Setting colorMode: true registers @nuxtjs/color-mode with sensible defaults (classSuffix: '', dataValue: 'theme')
  • Setting icon: true registers @nuxt/icon with cssLayer: 'base'

Released under the MIT License.