Skip to main content
VelinStyle v1.3.0
⌂ Home
  1. Docs
  2. Components
  3. Media
  4. Carousel

Carousel 1.2.2

The <velin-carousel> Web Component provides a touch-friendly slideshow with prev/next controls, dot indicators, optional autoplay with a pause control, and keyboard navigation. Deutsch: Karussell

Maturity: Documented as stable in VelinStyle 1.2.0. Design Intelligence (plan / review / agent meta) is separate and beta / foundation where noted.

When to use

When not

Basic Example

Slide 1
Slide 2
Slide 3
<velin-carousel>
  <div>Slide 1</div>
  <div>Slide 2</div>
  <div>Slide 3</div>
</velin-carousel>

Autoplay

Add the autoplay attribute. Set interval in milliseconds with interval (default 5000). A Pause / Play button appears in the indicator row (see pause control).

<velin-carousel autoplay interval="3000">
  <div>Slide 1</div>
  <div>Slide 2</div>
</velin-carousel>

Keyboard navigation

When focus is inside the carousel, arrow keys move between slides.

KeyAction
Arrow Left / Arrow RightPrevious / next slide
Home / EndFirst / last slide

Pause control

With autoplay, a pause button is added next to the dot indicators. It toggles aria-pressed, updates its label between “Pause automatic slide show” and “Resume automatic slide show”, and stops the timer until pressed again. Autoplay also pauses while the carousel is hovered or contains focus.

Accessibility

CSS Variables

VariableDescription
--velin-color-surface-brightControl button background
--velin-color-borderControl button border
--velin-color-primaryActive dot indicator
--velin-shadow-mdControl button shadow
--velin-color-focusFocus ring colour

API

Attributes

AttributeTypeDescription
autoplayBooleanObserved — enable auto-advancing slides
intervalNumberObserved — milliseconds between slides (default 5000)

Methods & events

APIDescription
prev() / next()Move one slide
goTo(index)Zero-based slide index
velin-slide-changeBubbles with detail: { index }

Parts

track, controls, prev, next, indicators. Default slot = slides.

Best practices & pitfalls