Carousel

Embla-powered slides with circular sketch arrows outside the viewport, matching the usual carousel layout.

1
2
3
4
5
<Carousel roughness={1.5}>
  <CarouselContent>
    <CarouselItem>
      <Card>1</Card>
    </CarouselItem>
  </CarouselContent>
  <CarouselPrevious />
  <CarouselNext />
</Carousel>

CLI install

npx doodleui-react add carousel

Usage

import {
  Card,
  Carousel,
  CarouselContent,
  CarouselItem,
  CarouselNext,
  CarouselPrevious,
} from "doodleui-react";

<div style={{ maxWidth: 280, margin: "0 auto" }}>
  <Carousel>
    <CarouselContent>
      <CarouselItem>
        <Card style={{ aspectRatio: "1 / 1" }}>1</Card>
      </CarouselItem>
      <CarouselItem>
        <Card style={{ aspectRatio: "1 / 1" }}>2</Card>
      </CarouselItem>
    </CarouselContent>
    <CarouselPrevious />
    <CarouselNext />
  </Carousel>
</div>

Props

PropTypeDefaultNotes
borderedbooleanfalseSketch frame around the slide viewport. Arrows stay outside.
orientation"horizontal" | "vertical""horizontal"Embla scroll axis.
animatebooleantrueDraw-in outer frame and nav button borders. Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.