Zum Hauptinhalt springen
VelinStyle v1.2.0
⌂ Startseite
  1. Docs
  2. Komponenten
  3. Karussell

Karussell 1.2.0

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. English: Carousel

Reifegrad: In VelinStyle 1.2.0 als stabil dokumentiert. Design Intelligence (Plan / Review / Agent-Meta) ist separat und, wo angegeben, Beta / Grundlage.

Wann verwenden

Wann nicht verwenden

Einfaches Beispiel

Folie 1
Folie 2
Folie 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>

Tastatur navigation

Wenn der Fokus im Karussell liegt, wechseln Pfeiltasten zwischen Folien.

TasteAktion
Arrow Links / Arrow RechtsVorherige / naechste Folie
Startseite / EndErste / letzte Folie

Pausensteuerung

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.

Barrierefreiheit

CSS-Variablen

VariableBeschreibung
--velin-color-surface-brightHintergrund der Steuerbuttons
--velin-color-borderRahmen der Steuerbuttons
--velin-color-primaryAktiver Punktindikator
--velin-shadow-mdSchatten der Steuerbuttons
--velin-color-focusFokus-Ring-Farbe

API

Attribut

AttributTypBeschreibung
autoplayBooleschObserved — enable auto-advancing slides
intervalZahlObserved — milliseconds between slides (default 5000)

Methodeen & events

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

Parts

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

Best practices & pitfalls