More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
items | Array<CarouselItem | string | ReactNode> | DEFAULT_ITEMS | Cards to show. Objects with image, icon, title, description and alt get the built-in card, strings are used as image URLs and React elements are rendered as they are. |
baseWidth | number | string | 300 | Width of the carousel in px, or any CSS width. It never grows past its container. |
aspectRatio | 1.25 | Width of a card divided by its height. | |
peek | Space on each side of the active card where the neighbours show, in px. Works with slide and scale. | ||
gap | 16 | Space between the cards in px. | |
radius | 12 | Corner radius of the cards in px. | |
frame | Holds the cards and controls in a panel that masks the cards as they slide out. Without it the cards fade out 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' | Navigation under the cards. Bars fill up with the autoplay timer. |
arrows | Shows previous and next buttons. | ||
autoplay | Moves to the next card on a timer. | ||
autoplayDelay | 3000 | Time on each card in ms while autoplay is on. | |
pauseOnHover | Pauses autoplay while the pointer is over the carousel. | ||
loop | Wraps around from the last card to the first and back. | ||
draggable | Lets people drag, swipe or scroll sideways through the cards. | ||
round | Turns the cards into circles. | ||
initialIndex | Card shown first. | ||
theme | 'dark' | 'light' | 'dark' | Color scheme of the cards, frame and controls. |
onChange | (index: number) => void | Called with the index of the new card whenever it changes. | |
| Extra class names for the carousel. | |||
| Inline styles for the carousel. |
itemsArray<CarouselItem | string | ReactNode>Cards to show. Objects with image, icon, title, description and alt get the built-in card, strings are used as image URLs and React elements are rendered as they are.
DEFAULT_ITEMSbaseWidthnumber | stringWidth of the carousel in px, or any CSS width. It never grows past its container.
300aspectRationumberWidth of a card divided by its height.
1.25peeknumberSpace on each side of the active card where the neighbours show, in px. Works with slide and scale.
gapnumberSpace between the cards in px.
16radiusnumberCorner radius of the cards in px.
12framebooleanHolds the cards and controls in a panel that masks the cards as they slide out. Without it the cards fade out at the edges.
effect'tilt' | 'slide' | 'scale' | 'fade' | 'cube'How the cards move from one to the next.
'tilt'indicator'dots' | 'bars' | 'counter' | 'none'Navigation under the cards. Bars fill up with the autoplay timer.
'dots'arrowsbooleanShows previous and next buttons.
autoplaybooleanMoves to the next card on a timer.
autoplayDelaynumberTime on each card in ms while autoplay is on.
3000pauseOnHoverbooleanPauses autoplay while the pointer is over the carousel.
loopbooleanWraps around from the last card to the first and back.
draggablebooleanLets people drag, swipe or scroll sideways through the cards.
roundbooleanTurns the cards into circles.
initialIndexnumberCard shown first.
theme'dark' | 'light'Color scheme of the cards, frame and controls.
'dark'onChange(index: number) => voidCalled with the index of the new card whenever it changes.
Extra class names for the carousel.
Inline styles for the carousel.
Dependencies
2 required packages
npm install @hugeicons/react @hugeicons/core-free-icons


