Data display

Carousel

@xui/carousel

A slideshow with arrows, dot indicators, keyboard support and optional autoplay (paused on hover). Choose the sliding (scrollx) or crossfade (fade) transition.

Install

pnpm add @xui/carousel

Add the barrel to a standalone component's imports:

import { XuiCarouselImports } from '@xui/carousel';

@Component({
  imports: [XuiCarouselImports],
  // …
})

Examples

Basic

Loading preview…

Autoplay

Loading preview…

Fade

Loading preview…

API

XuiCarouselItem

componentxui-carousel-item

One slide inside {@link XuiCarousel}. Its projected content is the slide.

XuiCarousel

componentxui-carousel

A slideshow of <xui-carousel-item> slides with arrows, dot indicators and optional autoplay (paused on hover). effect slides (scrollx) or crossfades (fade); index is two-way bindable.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''indextwo-waynumberZero-based index of the visible slide. Two-way bindable with [(index)].0autoplaybooleanAdvance on a timer. Pauses while the pointer is over the carousel, and does nothing with a single slide.falseintervalnumberMilliseconds between automatic advances. Only used with autoplay.3000dotsbooleanShow the per-slide indicators. Hidden anyway when there is only one slide.truearrowsbooleanShow the previous/next buttons. Hidden anyway when there is only one slide.trueloopbooleanWrap around at either end. With this off, the arrows stop at the first and last slide.trueeffect'scrollx' | 'fade'How slides change: sliding horizontally (scrollx, direction-aware in RTL) or cross-fading in place (fade).'scrollx'

Methods

next(): voidprev(): void

Source

libs/ui/carousel/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.