Carousel
A carousel component built on Embla Carousel with motion and swipe support. Provides horizontal and vertical orientation, keyboard navigation, plugin support, and full access to the Embla API for building custom controls.
Installation
Install via CLI
npx @moontra/moonui-cli add carouselUsage
Examples
Basic Carousel
A horizontal carousel with previous and next controls. Slides can be swiped with a pointer or navigated with the arrow keys while focused.
Vertical Orientation
Set orientation to vertical to scroll slides up and down. Give CarouselContent an explicit height and size the items with basis utilities to show multiple slides at once.
Slide Indicators with setApi
Pass a setApi callback to receive the Embla API instance and build custom controls, such as dot indicators and a slide counter driven by the select event.
Interactive Slide Content
Slides accept any content, including interactive elements like buttons. This example combines looping via opts with multiple items per view using basis utilities.
Aurora Desk Lamp
Nimbus Keyboard
Orbit Mouse
Lunar Monitor Stand
Eclipse Headphones