React Carousel Component API

Carousel API

Christmas Tree
Merry Christmas & Happy New Year
Extra 25% off for all sale items + Free CoreUI Icons PRO with every order!
Limited offer ends 1st January 2025, use code 2024XMAS25 during checkout.

Explore the API reference for the React Carousel component and discover how to effectively utilize its props for customization.

CCarousel#

import { CCarousel } from '@coreui/react'
// or
import CCarousel from '@coreui/react/src/components/carousel/CCarousel'
PropertyDefaultType
activeIndex#0number

index of the active item.

className#-string

A string of all className you want applied to the base component.

controls#-boolean

Adding in the previous and next controls.

dark#-boolean

Add darker controls, indicators, and captions.

indicators#-boolean

Adding indicators at the bottom of the carousel for each item.

interval#5000number, boolean

The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.

onSlid#-(active: number, direction: string) => void

Callback fired when a slide transition end.

onSlide#-(active: number, direction: string) => void

Callback fired when a slide transition starts.

pause#hoverboolean, 'hover'

If set to 'hover', pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. If set to false, hovering over the carousel won't pause it.

touch#4.5.0+trueboolean

Set whether the carousel should support left/right swipe interactions on touchscreen devices.

transition#-'slide', 'crossfade'

Set type of the transition.

wrap#trueboolean

Set whether the carousel should cycle continuously or have hard stops.

CCarouselCaption#

import { CCarouselCaption } from '@coreui/react'
// or
import CCarouselCaption from '@coreui/react/src/components/carousel/CCarouselCaption'
PropertyDefaultType
className#-string

A string of all className you want applied to the base component.

CCarouselItem#

import { CCarouselItem } from '@coreui/react'
// or
import CCarouselItem from '@coreui/react/src/components/carousel/CCarouselItem'
PropertyDefaultType
className#-string

A string of all className you want applied to the base component.

interval#falsenumber, boolean

The amount of time to delay between automatically cycling an item.