Skip to content

Carousel

<bh-carousel>

The Carousel component allows you to showcase images and custom content in an interactive slideshow format. It supports various animations, styles, and customization options to fit your design needs.

Features

  • Multiple animation types (slide, fade, zoom)
  • Various style variants (default, secondary, glass, tricolor)
  • Support for both image slides and custom content
  • Responsive design with touch support
  • Keyboard navigation
  • Autoplay with configurable interval
  • Customizable indicators and navigation arrows

Basic Usage

Variants

The carousel component comes with several built-in style variants to match your design needs.

Default

Secondary

Glass

Tricolor

Animations

Choose from different animation types for slide transitions.

Slide Animation

Fade Animation

Zoom Animation

Custom Content

You can also use custom content in your carousel slides by using slots.

📚

New Arrivals

Discover our latest collection of books and digital resources

👥

Book Club

Join our vibrant community of book lovers and discussions

Create responsive carousels that adapt to different screen sizes.

Properties

PropertyTypeDescription
animationstringAnimation type for slide transitions. Options: “slide”, “fade”, “zoom”
autoplaybooleanWhether to automatically advance slides
borderRadiusstringBorder radius of the carousel container
heightstringHeight of the carousel
imagesFitstringObject-fit property for images. Options: “cover”, “contain”, “fill”, “none”, “scale-down”
intervalnumberTime in milliseconds between slide transitions when autoplay is enabled
responsivearrayArray of objects with breakpoint and settings for responsive behavior
showArrowsbooleanWhether to show navigation arrows
showIndicatorsbooleanWhether to show slide indicators
slidesarrayArray of slide objects (alternative to using bh-carousel-item)
slidesToScrollnumberNumber of slides to scroll at a time
slidesToShownumberNumber of slides to show at a time
variantstringVisual style variant. Options: “default”, “secondary”, “glass”, “tricolor”
widthstringWidth of the carousel
pauseOnHoverbooleanWhether to pause autoplay when hovering over the carousel
touchEnabledbooleanWhether to enable touch/swipe navigation
accentColorstringCustom accent color for indicators and controls
PropertyTypeDescription
imagestringURL of the image to display
altstringAlt text for the image
titlestringTitle to display in the caption
captionstringCaption text to display
activebooleanWhether this slide is currently active
imagesFitstringObject-fit property for this specific image

Events

EventDescription
slide-changeFired when the active slide changes
autoplay-startFired when autoplay starts
autoplay-stopFired when autoplay stops