Skip to main content

Carousel

shadow

A Carousel is an element that displays multiple items, such as images or news updates, in a rotating fashion.

Basic usage​

The demo shows the simplest carousel with a few slides and default controls. Observe especially the basic behavior of the transition between items.

Paginaton​

The demo turns on pagination elements to make it clear how the user can move between slides even without gestures or arrows.

No loop​

The demonstration turns off infinite cycling. This makes the first and last slide function as the actual borders of the carousel.

Dialogue​

The sample inserts a carousel into the dialog, so it is good to see the behavior of the component in the limited space of the overlay.

Thumbnail image​

The preview adds thumbnails to the carousel, which act as secondary navigation between slides.

Offset​

The demo works with spacing between slides and around the viewport to see how the rhythm and density of the layout changes.

Five slides per page​

The sample uses slide-per-page="5", so that the carousel displays exactly five sibling items on one viewport. The width is also calculated with the gap between items, so five cards together fill 100% of the width without overflow. In a classic loop the carousel returns to the beginning after the last full view.

Continuous loop​

If you add continuous-loop, the multi-item carousel behaves like an infinite strip on the edges. So after 10 you can see 1 2 3 4, instead of immediately jumping back to the first full view.

One slide with custom layout​

The sample leaves slide-per-page="1" and inserts a custom five-card grid into a single wje-carousel-item. The wrapper stretches to the full width of the slide without the need for a fixed carousel width or additional width hacks in the application.

Distribution​

The preview divides the space so that multiple slides can be seen at once. Suitable for galleries or reports with higher information density.

When to use​

Use wje-carousel to display content that improves the readability, scannability, or context of the information.

When not to use​

Do not use it as a substitute for structured data where precise interaction is needed.

Accessibility​

Add alternative text for images, legible contrasts and text equivalents for icons without description.

  • Compress media and use lazy loading for large lists.
  • Keep information priorities consistent for tabs and lists.
  • Do not repeat the same information in text and icon at the same time with no added value.

Attributes and properties​

activeSlide​

PopisNastavuje číselnú hodnotu používanú vo voľbe active-slide.
Atribútactive-slide
Typnumber|number
Predvolené0

continuousLoop​

PopisUrčuje, či je voľba continuous-loop zapnutá a ovplyvňuje správanie komponentu.
Atribútcontinuous-loop
Typboolean
Predvolenéfalse

loop​

PopisUrčuje, či je voľba loop zapnutá a ovplyvňuje správanie komponentu.
Atribútloop
Typboolean
Predvolenéfalse
PopisUrčuje, či je voľba navigation zapnutá a ovplyvňuje správanie komponentu.
Atribútnavigation
Typboolean
Predvolenéfalse

pagination​

PopisUrčuje, či je voľba pagination zapnutá a ovplyvňuje správanie komponentu.
Atribútpagination
Typboolean
Predvolenéfalse

slidePerPage​

PopisNastavuje číselnú hodnotu používanú vo voľbe slide-per-page.
Atribútslide-per-page
Typnumber
Predvolené1

thumbnails​

PopisUrčuje, či je voľba thumbnails zapnutá a ovplyvňuje správanie komponentu.
Atribútthumbnails
Typboolean
Predvolenéfalse

Events​

No events available for this component.

Methods​

syncActiveToSnapStart​

PopisSynchronizuje active to snap start s externým alebo interným zdrojom stavu.
Signatúra() => void

syncSlideMetrics​

PopisSynchronizuje slide metrics s externým alebo interným zdrojom stavu.
Signatúra() => void

getScrollPaddingInlineStart​

PopisVráti scroll padding inline start z aktuálneho stavu komponentu.
Signatúra() => number

getControlBehavior​

PopisVráti control behavior z aktuálneho stavu komponentu.
Signatúra() => string

goToSlide​

PopisSpustí metódu goToSlide na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(index: any, behavior: any, next: any) => void

setActiveVisualSlide​

PopisNastaví active visual slide a aplikuje súvisiace zmeny stavu.
Signatúra(vIndex: number) => void

createLoopClone​

PopisVytvorí loop clone a pripojí ho do štruktúry komponentu.
Signatúra(item: HTMLElement) => HTMLElement

removeLoopClones​

PopisOdstráni loop clones z aktuálneho stavu komponentu.
Signatúra() => void

getLoopCloneCount​

PopisVráti loop clone count z aktuálneho stavu komponentu.
Signatúra(totalSlides: number) => number

scrollToVisualIndex​

PopisSpustí metódu scrollToVisualIndex na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(vIndex: number, behavior: string) => void

nextSlide​

PopisSpustí metódu nextSlide na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => void

previousSlide​

PopisSpustí metódu previousSlide na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => void

getSlides​

PopisVráti slides z aktuálneho stavu komponentu.
Signatúra() => Array

getMaxVisibleStartIndex​

PopisVráti max visible start index z aktuálneho stavu komponentu.
Signatúra(totalSlides: number) => number

normalizeLoopIndex​

PopisSpustí metódu normalizeLoopIndex na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra(index: number, totalSlides: number) => number

getLoopLogicalCount​

PopisVráti loop logical count z aktuálneho stavu komponentu.
Signatúra(totalSlides: number) => number

getPaginationIndexes​

PopisVráti pagination indexes z aktuálneho stavu komponentu.
Signatúra() => number[]

canGoNext​

PopisSpustí metódu canGoNext na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => boolean

canGoPrevious​

PopisSpustí metódu canGoPrevious na vykonanie logiky komponentu a aktualizáciu jeho stavu.
Signatúra() => boolean

CSS shadow parts​

Pre tento komponent nie sú dostupné žiadne CSS časti tieňa.

CSS custom variables​

NázovPopis
--wje-carousel-sizeVlastná CSS premenná na štýlovanie komponentu (size).
--wje-carousel-gapVlastná CSS premenná, ktorá riadi gap.

Slots​

NameDescription
defaultDefault slot for the main component content.