• Docs
  • Blog
    • 0.24.0

    • Switch to dark mode
    Get Started
    Components
    Styling
    Theming

    Concepts

    OverviewCompositionTesting

    Layout

    Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrap

    Components

    AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

    Utilities

    Feature FlagsForLocal StoragePortalShowsplitPropsTheme

    Carousel

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

    • npm
    • source
    • recipe
    • Ark
    import { Carousel } from '@cerberus/react'

    Usage

    Slide 1
    Slide 2
    Slide 3
    Slide 4
    Slide 5
    Slide 6
    Slide 7
    Slide 8
    Slide 9
    Slide 10

    With Indicators

    Use the showIndicators prop to display indicators for each slide.

    Slide 1
    Slide 2
    Slide 3
    Slide 4
    Slide 5
    Slide 6
    Slide 7
    Slide 8
    Slide 9
    Slide 10

    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.

    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

    • Edit this page on Github
    Cerberus Design System | Docs