Carousel

CardCheckbox

Swipeable slides with arrows, dots and autoplay.

Installation

pnpm add krz-ui

Usage

import { Carousel } from "krz-ui";
<Carousel slidesPerView={2} loop autoPlay={4000}>
  <img src="/1.jpg" alt="" />
  <img src="/2.jpg" alt="" />
  <img src="/3.jpg" alt="" />
</Carousel>

API Reference

PropTypeDescription
childrenReactNodeEach child is a slide.
slidesPerViewnumberSlides visible at once. Defaults to 1.
gapnumberSpace between slides in px. Defaults to 16.
loopbooleanWrap from the last slide to the first.
autoPlaynumberAdvance every N ms. Pauses on hover and focus.
showArrows / showDotsbooleanShow navigation controls. Both default to true.
onIndexChange(index: number) => voidCalled when the first visible slide changes.
className / style / ref—All go to the outer element. See Customization.
classNames{ viewport?, track?, slide?, arrow?, dots?, dot? }Extra classes for inner parts.