Skip to content

Carousel

Displays a carousel with previous and next buttons. Based on Embla Carousel.

Embla Carousel Options Embla Carousel Plugins

Import

Terminal window
import { Carousel } from "@aeonkit/react";

Usage

Simple

A simple carousel with images and some spacing between them.

Austin
Houston
Dallas

Vertical

You can change the orientation of the carousel by using the axis option.

Austin
Houston
Dallas

Autoplay

You can set the carousel to autoplay by using the Autoplay plugin. First, install the embla-carousel-autoplay package.

Terminal window
npm install embla-carousel-autoplay

Then, import the plugin.

Terminal window
import Autoplay from "embla-carousel-autoplay";
Austin
Houston
Dallas

Fade

You can set the carousel to fade by using the Fade plugin.

Terminal window
npm install embla-carousel-fade

Then, import the plugin.

Terminal window
import Fade from "embla-carousel-fade";
Austin
Houston
Dallas

You can add navigation arrows to the carousel by using the Carousel.Previous and Carousel.Next components.

Austin
Houston
Dallas

You can add navigation dots to the carousel by using the Carousel.Dots component.

Austin
Houston
Dallas

Custom Dots

You can customize the navigation dots by using the Carousel.Dots component and passing a render function.

Austin
Houston
Dallas

Multiple Slides

You can display multiple slides at once by setting the slidesToScroll option. You also need to set the flex basis of the slides to a percentage value.

Austin
Houston
Dallas

Props

options?

EmblaOptionsType

Options for the carousel. See the Embla Carousel documentation link above for more information.

plugins?

EmblaPluginType[]

Plugins for the carousel. See the Embla Carousel documentation link above for more information.

getCarouselApi?

(api: CarouselAPI) => void;

A function that receives the Embla Carousel API instance. Useful for controlling the carousel programmatically.

API Interface: CarouselProps