Skip to content
PixiKit

Carousel

A card carousel you can drag, fling, scroll sideways or step through with keys, with five transitions, three indicators, arrows, loop and autoplay.

pixikit.com/docs/components/carousel

Customize

Base width300px
Aspect ratio1.25
Peek0px
Gap16px
Radius12px
Frame
Effect
Indicator
Arrows
Autoplay
Autoplay delay3000ms
Pause on hover
Loop
Draggable
Round
Initial index0
Theme

Props

21
NameTypeDefaultDescription
items(CarouselItem | string | ReactNode)[]DEFAULT_ITEMSThe cards. Objects get the built-in card, strings are image URLs and React elements render as they are.
baseWidthnumber | string300The carousel's width in pixels, or any CSS width. It never grows past its container.
aspectRationumber1.25A card's width divided by its height.
peeknumber0Space on each side of the active card where its neighbours show, in pixels.
gapnumber16Space between cards, in pixels.
radiusnumber12Corner radius of the cards, in pixels.
framebooleantrueHolds the cards and controls in a panel that masks them as they slide out. Without it the cards fade at the edges.
effect"tilt" | "slide" | "scale" | "fade" | "cube""tilt"How the cards move from one to the next.
indicator"dots" | "bars" | "counter" | "none""dots"The navigation under the cards. Bars fill with the autoplay timer.
arrowsbooleanfalseShows previous and next buttons.
autoplaybooleanfalseMoves to the next card on a timer.
autoplayDelaynumber3000Time on each card while autoplay is on, in milliseconds.
pauseOnHoverbooleanfalseHolds the autoplay while the pointer or keyboard focus is on the carousel.
loopbooleanfalseWraps from the last card to the first and back.
draggablebooleantrueLets people drag, swipe or scroll sideways through the cards.
roundbooleanfalseTurns the cards into circles.
initialIndexnumber0The card shown first, counting from 0.
theme"dark" | "light""dark"Color scheme of the cards, frame and controls.
onChange(index: number) => voidNoneCalled with the index of the new card whenever it changes.
classNamestringNone
styleCSSPropertiesNone

More media components in Pro

View all

Related