DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Carousel

Used to cycle through a series of visual content within a container.

  • npm
  • source
  • recipe
  • Ark
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { Carousel } from '@cerberus/react'

Usage

Loading example...

With Indicators

Use the showIndicators prop to display indicators for each slide.

Loading example...

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

Data Attributes

The primitives additionally use the following data attributes for custom styling:

AttributeValue
[data-scope]carousel
[data-part]root
[data-orientation]The orientation of the carousel

Root CSS Variables

The Root primitive sets the following CSS variables for customization:

VariableDescription
--slides-per-pageThe number of slides visible per page
--slide-spacingThe spacing between slides
--slide-item-sizeThe calculated size of each slide item

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.

Note

It is best to only use the CarouselParts if you are building a custom solution. Importing Object based components will ship every property it includes into your bundle, regardless if you use it or not.

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.

On this page

  • Import
  • Usage
  • With Indicators
  • Primitives
    • Data Attributes
    • Root CSS Variables
  • API
    • Props
    • Parts
Edit this page on Github
Slide 0
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
Slide 0
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9