Carousel

The carousel component typically consists of a slider with images content, for displaying information.

Preview

Usage

The carousel component manages the slider logic internally using a custom hook, useCarousel.

Customization With Props

  • images -> Accepts an array of string values, which may be the source links of the images, used in the slider.

  • id -> The id prop is similar to the id attribute in HTML. It allows to provide overall component id.

  • imgLoad -> The imgLoad prop is mapped to the loading attribute in HTML img tag. It allows to provide overall the value for loading attribute, "lazy" | "eager".

  • userCarouselStyle -> Accepts class name(s) as string, the custom style prop for the carousel container.

  • userImagesStyle -> Accepts class name(s) as string, the custom style prop for the images container.

Example:

Component Code

This is the code for the Carousel component.

Last updated