v1.3.0 28

Carousel

A slideshow component for cycling through elements like images or cards.

Interactive Requires: veritheme.js JS init: automatic

Default

A simple carousel showing one slide at a time with navigation arrows.

html

With Indicators

Carousel with dot indicators to show current position.

html

Multiple Slides

Shows multiple slides visible at once in a row.

html

Carousel of product cards, two at a time.

html

Centered testimonial with author info, dots, and the buttons under the slides.

html

Guidelines

Do Pair navigation arrows with dot indicators for orientation.
Don't Don't hide navigation — users can't tell more slides exist.

Anatomy

div.vt-carousel[data-vt-carousel]                ← Carousel root (data-vt-total, data-vt-visible)
├── div.vt-carousel-content                    ← Buttons and the viewport in a row
│   ├── button.vt-btn….vt-carousel-nav[data-vt-carousel-prev]   ← Previous
│   ├── div.vt-carousel-viewport               ← Clips the track
│   │   └── div.vt-carousel-track[data-vt-carousel-track]  ← Moves sideways
│   │       └── div.vt-carousel-slide          ← One slide
│   └── button.vt-btn….vt-carousel-nav[data-vt-carousel-next]   ← Next
└── div.vt-carousel-dots[data-vt-carousel-dots]   ← Dot indicators (optional)
    └── button.vt-carousel-dot[data-vt-dot="n"]   ← One dot, vt-active when current

API Reference

Class Type Description
vt-carousel Base Root — rows stacked 16px apart; carries data-vt-carousel, data-vt-total and data-vt-visible
vt-carousel-content Part Row of the previous button, the viewport and the next button, 16px apart
vt-carousel-viewport Part Takes the rest of the row and clips the track
vt-carousel-track Part The strip of slides, 16px apart (data-vt-carousel-track); moves on navigation
vt-carousel-slide Part One slide — the full viewport, or a half / third of it with data-vt-visible="2|3"
vt-btnvt-btn-borderedvt-btn-iconvt-btn-smvt-carousel-nav Part Previous / next (data-vt-carousel-prev / data-vt-carousel-next) — a round bordered icon button, disabled at either end
vt-carousel-controls Part Centered row for the buttons when they sit under the slides
vt-carousel-dots Part Centered row of dots (data-vt-carousel-dots)
vt-carousel-dot Part One dot, 8px (data-vt-dot="n", aria-label)
vt-carousel-dotvt-active State The current slide — brand fill, aria-current="true"
data-vt-total Attribute Number of slides
data-vt-visible Attribute Slides visible at once: 1 (default), 2 or 3

Accessibility

Feature Details
Role The root is role="region" with aria-roledescription="carousel" and an aria-label
Slides Each slide is role="group" with aria-roledescription="slide" and a label such as "1 of 5"
Controls Previous / next and every dot carry an aria-label; the buttons are disabled at the ends
Auto-play Provide a pause button if slides rotate on their own, and respect prefers-reduced-motion