Carousel

A component for displaying a series of items in a sliding format.

import { Carousel } from '@cerberus/react'

Usage

With Indicators

Use the showIndicators prop to display indicators for each slide.

Primitives

You can utilize the primitive components or the css prop to customize the button.

ComponentDescription
CarouselRootThe context provider for the Carousel parts
CarouselControlThe container of the Next and Prev triggers
CarouselPrevTriggerThe button to navigate to the previous slide
CarouselNextTriggerThe button to navigate to the next slide
CarouselItemGroupThe container for the Carousel items
CarouselItemThe individual item within the Carousel
CarouselIndicatorGroupThe container for the indicators
CarouselIndicatorThe individual indicator representing each slide

API

Props

The Carousel component is an abstraction of the primitives and accepts the following props:

NameDefaultDescription
showIndicatorsfalseWhether to show indicators for each slide.

The Carousel also accepts all the props of the Root component.

Parts

The CarouselParts API is an Object containing the full family of components.

NameDescription
RootThe Carousel component which is the Provider for the family.
ControlThe container of the Next and Prev triggers.
PrevTriggerThe button to navigate to the previous slide.
NextTriggerThe button to navigate to the next slide.
ItemGroupThe container for the Carousel items.
ItemThe CarouselItem component which represents an individual item within the carousel.
IndicatorGroupThe container for the indicators.
IndicatorThe individual indicator representing each slide.