Carousel

Carousels show a collection of items that can be scrolled on and off the screen

Known Limitations (Beta)

  • Responsive behavior on mobile is not supported.
  • Only the default (hero) variant is supported.

Use Carousel with CarouselItem children to create a horizontally scrollable showcase.

import { Carousel, CarouselItem } from "@udixio/ui-react"
<Carousel variant="hero" gap={8}>
  <CarouselItem>
    <div className="p-6 bg-surface rounded-xl">Slide 1</div>
  </CarouselItem>
  <CarouselItem>
    <div className="p-6 bg-surface rounded-xl">Slide 2</div>
  </CarouselItem>
  <CarouselItem>
    <div className="p-6 bg-surface rounded-xl">Slide 3</div>
  </CarouselItem>
</Carousel>

Behavior and callbacks

  • gap: spacing between items.
  • marginPourcent: outer margins as a percentage of the viewport width.
  • scrollSensitivity: adjust scroll/drag responsiveness.
  • onChange: called with the active index.

With navigation buttons