Interactive Carousel

An interactive carousel component built with Embla Carousel that visually highlights selected items with smooth sliding background transitions. Features hover and click interactions, perfect for creating engaging lists, menus, and navigation elements with clear selection feedback.

Installation

npx uilayouts@latest add carousel

Usage

1
2
import type { EmblaOptionsType } from 'embla-carousel';
3
import {
4
Carousel,
5
Slider,
6
SliderContainer,
7
SliderDotButton,
8
SliderNextButton,
9
SliderPrevButton,
10
} from './carousel';
11
12
function index() {
13
const OPTIONS: EmblaOptionsType = { loop: false };
14
return (
15
<>
16
<Carousel options={OPTIONS}>
17
<SliderContainer>
18
<Slider></Slider>
19
<Slider></Slider>
20
<Slider></Slider>
21
</SliderContainer>
22
23
<SliderPrevButton>
24
<ChevronLeft />
25
</SliderPrevButton>
26
27
<SliderNextButton>
28
<ChevronRight />
29
</SliderNextButton>
30
31
<SliderDotButton />
32
33
<SliderSnapDisplay />
34
</Carousel>
35
</>
36
);
37
}

Props

PropTypeDefaultDescription
defaultValuestringstring[]undefined
multiplebooleanfalseWhether the accordion allows multiple items to be active at the same time
childrenReactNode[]undefinedThe accordion items, including their headers and panels
classNamestring''Optional CSS class for styling the accordion wrapper

Example

Align Slider

Classname Slider

Number Slider

Scale Slider

Thumbnail Slider

Autostart Slider

Autoscroll Slider

Slide 1

Slide 2

Slide 3

Slide 4

Vertical Slider

Vertical Thumbnail Slider

Vertical Autostart Thumbnail Slider