Introducing PrimeReact v11-alpha 🎉Discover Now
styledMedia

Carousel

Carousel is a content slider featuring various customization options.

preview

Usage#

import { Carousel } from '@primereact/ui/carousel';
<Carousel.Root>
    <Carousel.Content>
        <Carousel.Item></Carousel.Item>
    </Carousel.Content>
    <Carousel.Indicators />
    <Carousel.Prev></Carousel.Prev>
    <Carousel.Next></Carousel.Next>
</Carousel.Root>

Examples#

Basic#

Cycles through a set of items with navigation controls.

basic-demo

Alignment#

Use the align property to align the carousel items. slidesPerPage property is used to control the number of slides visible per page.

alignment-demo

Orientation#

Use the orientation property to change the orientation of the carousel.

orientation-demo

Loop#

Use the loop property to enable loop mode.

loop-demo

Variable Size#

Use the autoSize property to enable auto size mode and set the width of the carousel items.

variable-size-demo

Gallery demo shows how to use the slide property to scroll to a specific slide by index.

gallery-demo

API#

Sub-Components#

See Primitive API for CarouselRoot, CarouselContent, CarouselItem, CarouselPrev, CarouselNext, CarouselIndicators, CarouselIndicator component documentation.

Hooks#

See Headless API for useCarousel hook documentation.

Accessibility#

See Carousel Primitive for WAI-ARIA compliance details and keyboard support.