The following props are available for carousel component. These are the custom props that we've added for the carousel component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
prevArrow | Prev Arrow | Change the previous arrow component for carousel | Arrow |
nextArrow | Next Arrow | Change the next arrow component for carousel | Arrow |
navigation | Navigation | Change the navigation component for carousel | Dots |
slideRef | Slide Ref | Add reference for the carousel slide | undefined |
autoplay | boolean | Sets the autoplay mode for carousel | false |
autoplayDelay | number | Sets the interval duration for autoplay mode in miliseconds | 5000 |
transition | Framer Motion | Sets the transition for carousel |
|
loop | boolean | Sets the looping mode for the carousel | false |
className | string | Add custom className for card | '' |
children | node | Add content for card | No default value it's a required prop. |
import type { CarouselProps } from "@material-tailwind/react";
type prevArrow = (args: {
loop: boolean;
handlePrev: () => void;
activeIndex: number;
firstIndex: boolean;
}) => React.ReactNode | void;
type nextArrow = (args: {
loop: boolean;
handleNext: () => void;
activeIndex: number;
lastIndex: boolean;
}) => React.ReactNode | void;
type navigation = (args: {
setActiveIndex: React.Dispatch<React.SetStateAction<number>>;
activeIndex: number;
length: number;
}) => React.ReactNode | void;
export type slideRef = React.Ref<HTMLDivElement>;