# Carousel
A draggable strip of slides that snaps where the flick was aimed.
Source page: https://dinachi.dev/docs/components/carousel

## Installation
```bash
npx @dinachi/cli@latest add carousel
```
Adds to your project:
- `components/ui/carousel/carousel.tsx`
- `components/ui/carousel/index.ts`
Installs:
- `motion` ^12.23.6

## Usage
```tsx
import {
  Carousel,
  CarouselDots,
  CarouselNext,
  CarouselPrevious,
  CarouselSlide,
  CarouselViewport,
} from "@/components/ui/carousel"

const slides = [
  { id: "1", title: "Projection" },
  { id: "2", title: "Velocity handoff" },
  { id: "3", title: "Elastic edges" },
]

export function Highlights() {
  return (
    <Carousel label="Highlights">
      <CarouselViewport>
        {slides.map((slide) => (
          <CarouselSlide key={slide.id} label={slide.title}>
            <div className="h-40 rounded-lg border p-4">{slide.title}</div>
          </CarouselSlide>
        ))}
      </CarouselViewport>
      <div className="flex items-center justify-between">
        <CarouselDots labels={slides.map((s) => s.title)} />
        <div className="flex gap-1.5">
          <CarouselPrevious />
          <CarouselNext />
        </div>
      </div>
    </Carousel>
  )
}
```

## Anatomy
```tsx
<Carousel>
  <CarouselViewport>
    <CarouselSlide />
  </CarouselViewport>
  <CarouselDots />
  <CarouselPrevious />
  <CarouselNext />
</Carousel>
```
- `Carousel`: Holds the current slide and names the set.
- `CarouselViewport`: The window the strip moves in.
- `CarouselSlide`: One slide, 72% of the viewport by default.
- `CarouselDots`: One button per measured slide.
- `CarouselPrevious`: Moves back one slide. Disabled on the first.
- `CarouselNext`: Moves forward one slide. Disabled on the last.

## Examples

### Default
Flick it, then drag it slowly and let go.
```tsx
import {
  Carousel,
  CarouselViewport,
  CarouselSlide,
  CarouselDots,
  CarouselPrevious,
  CarouselNext,
} from '@/components/ui/carousel';

export function Example() {
  return (
    <Carousel label="Gesture techniques">
      <CarouselViewport>
        {slides.map((slide) => (
          <CarouselSlide key={slide.id} label={slide.title}>
            <Card slide={slide} />
          </CarouselSlide>
        ))}
      </CarouselViewport>

      <div className="flex items-center justify-between">
        <CarouselDots labels={slides.map((s) => s.title)} />
        <div className="flex gap-1.5">
          <CarouselPrevious />
          <CarouselNext />
        </div>
      </div>
    </Carousel>
  );
}
```

### Uneven slides
Nothing here assumes a slide width.
```tsx
// Positions are read from the DOM, not derived from a nominal slide width, so a
// mixed set lands as accurately as an even one.
<CarouselSlide label={slide.title} className="w-[45%]">
  <Card slide={slide} />
</CarouselSlide>
```

### Controlled
The index lives with you.
```tsx
const [index, setIndex] = useState(0);

<Carousel label="Highlights" index={index} onIndexChange={setIndex}>
  {/* ... */}
</Carousel>

<p>Slide {index + 1} of {slides.length}</p>
```

## Notes

### Motion tier
Needs [motion](https://motion.dev). `add --all` skips it; install with `add --motion` or by name.

### Snapping
On release, the velocity is projected 200ms forward from the strip's position and the strip snaps to the slide that lands in. A flick advances; a slow drag that stops short does not.

### Slide sizes
Slide positions are measured from layout, so gaps set by class, uneven widths and container padding all work. A resize re-aligns the strip to the current slide. The dots count the measured slides.

### Reduced motion
The drag is replaced by a native scroll-snap strip. Dots and arrows jump instead of animating. Honours the OS setting and an app-level `<MotionConfig reducedMotion>`.

### When to use it
- A short set viewed one at a time: highlights, screenshots, testimonials. Suits touch-first surfaces.
- For content to compare side by side, use a grid.
- Do not hide content that matters; off-screen slides read as optional.

## API reference
Props marked **agent** change what an agent reads or may do.

### Carousel
Holds the current slide and names the set.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` **agent** | `string` | `"Carousel"` | Names the carousel for screen readers and the agent. |
| `index` | `number` | - | Controlled current slide, from 0. |
| `defaultIndex` | `number` | `0` | Starting slide when uncontrolled. |
| `onIndexChange` **agent** | `(index, details) => void` | - | Runs for people and agents. `details.reason` says why, and `details.cancel()` keeps the current slide. |
| `disabled` **agent** | `boolean` | `false` | Turns off the drag, the arrows and the dots, and blocks agents. |

### CarouselViewport
The window the strip moves in.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | - | `CarouselSlide` elements, placed directly inside. |

### CarouselSlide
One slide, 72% of the viewport by default.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` **agent** | `string` | - | Names the slide; falls back to its position. Agents pick slides by it. |
| `className` | `string` | - | Set the width here. Uneven widths are fine. |

### CarouselDots
One button per measured slide.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `labels` | `string[]` | - | Slide names, in order, used in each dot's accessible name. |
| `dotClassName` | `string` | - | Class applied to every dot. |

### CarouselPrevious
Moves back one slide. Disabled on the first.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | `chevron icon` | Replaces the icon. The button keeps its aria-label. |

### CarouselNext
Moves forward one slide. Disabled on the last.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | `chevron icon` | Replaces the icon. The button keeps its aria-label. |

## Agent
Inside an `AgentProvider`, Carousel appears in `agent.snapshot()` as `carousel`.
Reads:
- `label`: The Carousel's label.
- `value`: The current slide's label, or its number when unnamed.
- `items`: Every slide's label, in order.
- `disabled`: True when the carousel is disabled.
Actions:
- `goTo("Velocity handoff")`: Moves by label, or by number from 1. A miss lists the slides.
An agent's move runs through `onIndexChange` like a drag or dot press. `isAgentChange(details)` is true for it; `details.cancel()` refuses it and the agent is told the app refused. A disabled carousel refuses on its own. The dots and arrows are not listed separately.
```ts
await agent.act({
  steps: [{ ref: "Gesture techniques", action: "goTo", args: ["Velocity handoff"] }],
})
```

## Accessibility
- The root is role="group" with aria-roledescription="carousel" and your label.
- Each slide is a group with aria-roledescription="slide", named with its position: "2 of 4: Velocity handoff".
- The dots are buttons in a group named "Choose a slide"; the current one has aria-current.
- The set does not wrap. The arrow at either end is disabled.
- The strip has no arrow-key handling. Keyboard users move with the dots and arrows.
### Keyboard
| Keys | Does |
| --- | --- |
| `Tab` | Moves between the dots and the arrows |
| `Enter` / `Space` | On a dot or an arrow, moves to that slide |

## Source
`components/ui/carousel/carousel.tsx`
```tsx
"use client"

import * as React from "react"
import {
  animate,
  motion,
  useMotionValue,
  MotionConfigContext,
  useReducedMotion,
  type PanInfo,
} from "motion/react"
import { cn } from "@/lib/utils"
import {
  changeAsAgent,
  matchAgentChoice,
  useAgentControl,
  useHasAgent,
  useMergedRef,
} from "@/components/ui/agent"

/**
 * A carousel that lands where the flick was aimed.
 *
 * Snap-to-nearest is the wrong rule. It measures where the finger stopped, which on a quick
 * flick is barely past the slide it started on, so a decisive gesture bounces back and the
 * carousel feels stuck. Projecting the release velocity forward and snapping to whichever
 * slide *that* lands in gets the opposite behaviour: a flick advances, a slow drag that
 * stops short does not, and both match what the hand meant.
 *
 * Under reduced motion the drag is switched off and this becomes an ordinary scroll-snap
 * strip. That is not a downgrade — a native scroller is a better carousel than a JS one for
 * anyone who did not want the momentum in the first place. The dots and the arrows keep
 * working either way; they just jump instead of animating.
 */

/** `useReducedMotion` reads the OS setting only, and only at mount. Also honour an
 *  app-level `<MotionConfig reducedMotion>`, so a user preference in the host app
 *  reaches this component. */
function useReducedMotionConfig() {
  const config = React.useContext(MotionConfigContext)
  const prefersReduced = useReducedMotion()
  if (config.reducedMotion === "always") return true
  if (config.reducedMotion === "never") return false
  return prefersReduced ?? false
}

/** Seconds of deceleration to project forward before choosing a slide. */
const PROJECTION = 0.2

const SNAP = { type: "spring", stiffness: 380, damping: 40, mass: 0.9 } as const

/** What moved the carousel. Cancel one from `onIndexChange` and it stays where it was. */
export interface CarouselChangeDetails {
  reason: "arrow-press" | "dot-press" | "drag" | "scroll" | "imperative-action"
  event: Event | undefined
  isCanceled: boolean
  cancel: () => void
}

function personChange(reason: Exclude<CarouselChangeDetails["reason"], "imperative-action">, event?: Event) {
  const details: CarouselChangeDetails = {
    reason,
    event,
    isCanceled: false,
    cancel: () => {
      details.isCanceled = true
    },
  }
  return details
}

/** Inside `AgentProvider` the carousel is one control, so its arrows and dots stay out. */
const usePart = () => (useHasAgent() ? "" : undefined)

interface CarouselContextValue {
  index: number
  count: number
  goTo: (next: number, details: CarouselChangeDetails, velocity?: number) => void
  disabled: boolean
  reducedMotion: boolean
  x: ReturnType<typeof useMotionValue<number>>
  offsets: number[]
  setOffsets: (offsets: number[]) => void
  scroller: React.RefObject<HTMLDivElement | null>
  registerSlide: (position: number, node: HTMLDivElement | null) => void
  /** Reads every slide's position out of the layout. Trims to `count` first, because a
   *  shortened list leaves stale nodes behind and a stale node still reports an offset. */
  measureSlides: (count: number) => number[]
  currentIndex: () => number
  setIndex: (next: number, details: CarouselChangeDetails) => number
}

const CarouselContext = React.createContext<CarouselContextValue | null>(null)

function useCarousel(component: string) {
  const context = React.useContext(CarouselContext)
  if (!context) {
    throw new Error(`${component} must be used within a Carousel`)
  }
  return context
}

/** Position within the strip, handed down so a slide does not have to count itself. */
const CarouselSlotContext = React.createContext<number | null>(null)

export interface CarouselProps extends React.ComponentProps<"div"> {
  /** Names the carousel. Screen readers read it before the slide. */
  label?: string
  index?: number
  defaultIndex?: number
  /** Fired when the slide changes. Cancel `details` to stay on the current slide. */
  onIndexChange?: (index: number, details: CarouselChangeDetails) => void
  /** Turns off the drag, the arrows and the dots. */
  disabled?: boolean
}

const Carousel = React.forwardRef<HTMLDivElement, CarouselProps>(
  (
    {
      label = "Carousel",
      index: indexProp,
      defaultIndex = 0,
      onIndexChange,
      disabled = false,
      className,
      children,
      ...props
    },
    ref
  ) => {
    const reducedMotion = useReducedMotionConfig()
    const [uncontrolled, setUncontrolled] = React.useState(defaultIndex)
    const index = indexProp ?? uncontrolled

    const x = useMotionValue(0)
    const scroller = React.useRef<HTMLDivElement>(null)
    const slides = React.useRef<(HTMLDivElement | null)[]>([])
    const [offsets, setOffsets] = React.useState<number[]>([])
    // Slides are counted by measuring them, so the dots cannot get out of step with the
    // strip they control.
    const count = offsets.length

    // The resize and scroll handlers need to know where we are without being rebuilt
    // every time we move.
    const indexRef = React.useRef(index)
    React.useEffect(() => {
      indexRef.current = index
    }, [index])

    /** Moves to `next` unless the app cancels, and returns the slide it is on after. */
    const setIndex = React.useCallback(
      (next: number, details: CarouselChangeDetails) => {
        // Scrolling reports the same slide many times over. Only a change is news.
        if (next === indexRef.current) return next
        onIndexChange?.(next, details)
        if (details.isCanceled) return indexRef.current
        indexRef.current = next
        if (indexProp === undefined) setUncontrolled(next)
        return next
      },
      [indexProp, onIndexChange]
    )

    const currentIndex = React.useCallback(() => indexRef.current, [])

    const registerSlide = React.useCallback(
      (position: number, node: HTMLDivElement | null) => {
        slides.current[position] = node
      },
      []
    )

    const measureSlides = React.useCallback((slideCount: number) => {
      slides.current.length = slideCount
      return slides.current.map((slide) => slide?.offsetLeft ?? 0)
    }, [])

    const goTo = React.useCallback(
      (next: number, details: CarouselChangeDetails, velocity = 0) => {
        const last = offsets.length - 1
        if (last < 0) return
        // A cancelled change still settles the strip, back onto the slide it stayed on.
        const landed = setIndex(Math.min(Math.max(next, 0), last), details)

        const to = offsets[landed]
        if (to === undefined) return

        if (reducedMotion) {
          scroller.current?.scrollTo({ left: to, behavior: "auto" })
          return
        }
        animate(x, -to, { ...SNAP, velocity })
      },
      [offsets, setIndex, reducedMotion, x]
    )

    const root = React.useRef<HTMLDivElement>(null)
    useAgentControl(() => {
      const nodes = slides.current.slice(0, count)
      const choices = nodes.map((node, i) => ({ value: i + 1, label: slideName(node, i) }))
      return {
        kind: "carousel",
        element: root.current,
        value: choices[index]?.label,
        items: choices.map((c) => c.label),
        disabled,
        actions: {
          goTo: (wanted: unknown) => {
            const match = matchAgentChoice(choices, wanted)
            if (typeof match === "string") return match
            if (offsets.length === 0) return "The carousel has not measured its slides yet"
            return changeAsAgent<number, CarouselChangeDetails>(goTo, match.value - 1)
          },
        },
      }
    })

    const context = React.useMemo(
      () => ({
        index,
        count,
        goTo,
        disabled,
        reducedMotion,
        x,
        offsets,
        setOffsets,
        scroller,
        registerSlide,
        measureSlides,
        currentIndex,
        setIndex,
      }),
      [
        index,
        count,
        goTo,
        disabled,
        reducedMotion,
        x,
        offsets,
        registerSlide,
        measureSlides,
        currentIndex,
        setIndex,
      ]
    )

    return (
      <CarouselContext.Provider value={context}>
        <div
          ref={useMergedRef(ref, root)}
          role="group"
          aria-roledescription="carousel"
          aria-label={label}
          data-disabled={disabled ? "" : undefined}
          className={cn("space-y-4", className)}
          data-slot="carousel"
          {...props}
        >
          {children}
        </div>
      </CarouselContext.Provider>
    )
  }
)
Carousel.displayName = "Carousel"

export type CarouselViewportProps = React.ComponentProps<"div">

/** The window the strip moves inside. Everything measured is measured from here. */
const CarouselViewport = React.forwardRef<HTMLDivElement, CarouselViewportProps>(
  ({ className, children, ...props }, ref) => {
    const {
      x,
      offsets,
      setOffsets,
      goTo,
      disabled,
      reducedMotion,
      scroller,
      measureSlides,
      currentIndex,
      setIndex,
    } = useCarousel("CarouselViewport")

    /**
     * Where each slide actually starts, read from the DOM.
     *
     * The obvious shortcut is `viewport.width * 0.72 + gap`, and it is wrong the moment the
     * gap comes from a class rather than a constant, or a slide is a different width, or the
     * container has padding. Asking the layout where the slides are costs one measurement
     * per resize and cannot drift.
     */
    const slideCount = React.Children.count(children)

    React.useEffect(() => {
      const node = scroller.current
      if (!node || typeof ResizeObserver === "undefined") return

      const measure = () => {
        const next = measureSlides(slideCount)
        setOffsets(next)

        // A resize moves every slide. Without this the strip keeps its old translation and
        // the carousel silently ends up sitting between two of them.
        const to = next[currentIndex()]
        if (to === undefined) return
        if (reducedMotion) node.scrollTo({ left: to, behavior: "auto" })
        else x.set(-to)
      }

      const observer = new ResizeObserver(measure)
      observer.observe(node)
      return () => observer.disconnect()
    }, [
      x,
      reducedMotion,
      scroller,
      setOffsets,
      measureSlides,
      currentIndex,
      slideCount,
    ])

    const positioned = React.Children.map(children, (child, i) => (
      <CarouselSlotContext.Provider value={i}>{child}</CarouselSlotContext.Provider>
    ))

    if (reducedMotion) {
      return (
        <div
          ref={mergeRefs(ref, scroller)}
          // Under reduced motion the browser's own scroller does the work, so the only
          // thing left to do is keep the dots honest about where it stopped.
          onScroll={(event) => {
            if (offsets.length === 0) return
            const target = nearest(offsets, event.currentTarget.scrollLeft)
            const landed = setIndex(target, personChange("scroll", event.nativeEvent))
            if (landed !== target) event.currentTarget.scrollTo({ left: offsets[landed], behavior: "auto" })
          }}
          className={cn(
            "relative flex snap-x snap-mandatory gap-3 pb-2",
            disabled ? "overflow-x-hidden" : "overflow-x-auto",
            className
          )}
          data-slot="carousel-viewport"
          {...props}
        >
          {positioned}
        </div>
      )
    }

    const onDragEnd = (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo) => {
      if (offsets.length === 0) return

      const projected = -(x.get() + info.velocity.x * PROJECTION)
      // Nearest by measured position rather than by dividing through a nominal slide width,
      // so uneven slides land as accurately as even ones.
      goTo(nearest(offsets, projected), personChange("drag", event), info.velocity.x)
    }

    return (
      <div
        ref={mergeRefs(ref, scroller)}
        className={cn("overflow-hidden", className)}
        data-slot="carousel-viewport"
        {...props}
      >
        <motion.div
          drag={disabled ? false : "x"}
          style={{ x }}
          dragConstraints={{ left: -(offsets[offsets.length - 1] ?? 0), right: 0 }}
          // Give at both ends rather than a wall, so the edge of the set is something you
          // feel instead of something you hit.
          dragElastic={0.16}
          dragMomentum={false}
          onDragEnd={onDragEnd}
          // `relative` makes the strip the offset parent, so each slide's `offsetLeft` is
          // its position within the strip rather than within the page.
          className="relative flex cursor-grab touch-pan-y gap-3 active:cursor-grabbing"
        >
          {positioned}
        </motion.div>
      </div>
    )
  }
)
CarouselViewport.displayName = "CarouselViewport"

export interface CarouselSlideProps extends React.ComponentProps<"div"> {
  /** Names this slide. Falls back to its position in the set. */
  label?: string
}

const CarouselSlide = React.forwardRef<HTMLDivElement, CarouselSlideProps>(
  ({ label, className, ...props }, ref) => {
    const { count, registerSlide } = useCarousel("CarouselSlide")
    const position = React.useContext(CarouselSlotContext)
    if (position === null) {
      throw new Error("CarouselSlide must be used within a CarouselViewport")
    }

    const counted = `${position + 1} of ${count || position + 1}`

    return (
      <div
        ref={mergeRefs(ref, (node: HTMLDivElement | null) => {
          registerSlide(position, node)
        })}
        role="group"
        aria-roledescription="slide"
        aria-label={label ? `${counted}: ${label}` : counted}
        className={cn("w-[72%] shrink-0 snap-start", className)}
        data-slot="carousel-slide"
        {...props}
      />
    )
  }
)
CarouselSlide.displayName = "CarouselSlide"

export interface CarouselDotsProps extends React.ComponentProps<"div"> {
  /** Slide names, in order. Used in each dot's accessible name. */
  labels?: string[]
  dotClassName?: string
}

/**
 * Not tabs.
 *
 * A tab controls a panel that appears in its place; these move a strip that is already
 * fully present, and calling them tabs promises a `tabpanel` relationship that does not
 * exist. They are buttons that jump.
 */
const CarouselDots = React.forwardRef<HTMLDivElement, CarouselDotsProps>(
  ({ labels, dotClassName, className, ...props }, ref) => {
    const { index, count, goTo, disabled } = useCarousel("CarouselDots")
    const part = usePart()

    return (
      <div
        ref={ref}
        role="group"
        aria-label="Choose a slide"
        className={cn("flex gap-1.5", className)}
        data-slot="carousel-dots"
        {...props}
      >
        {Array.from({ length: count }, (_, i) => (
          <button
            key={i}
            type="button"
            aria-label={
              labels?.[i] ? `Go to slide ${i + 1}: ${labels[i]}` : `Go to slide ${i + 1}`
            }
            aria-current={i === index ? "true" : undefined}
            disabled={disabled}
            data-agent-part={part}
            onClick={(event) => goTo(i, personChange("dot-press", event.nativeEvent))}
            className={cn(
              "h-1.5 rounded-full transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
              i === index ? "w-6 bg-primary" : "w-1.5 bg-border hover:bg-muted-foreground",
              dotClassName
            )}
          />
        ))}
      </div>
    )
  }
)
CarouselDots.displayName = "CarouselDots"

export type CarouselArrowProps = React.ComponentProps<"button">

const CarouselPrevious = React.forwardRef<HTMLButtonElement, CarouselArrowProps>(
  ({ className, children, ...props }, ref) => {
    const { index, goTo, disabled } = useCarousel("CarouselPrevious")

    return (
      <button
        ref={ref}
        type="button"
        aria-label="Previous slide"
        disabled={disabled || index === 0}
        data-agent-part={usePart()}
        onClick={(event) => goTo(index - 1, personChange("arrow-press", event.nativeEvent))}
        className={cn(arrowClass, className)}
        data-slot="carousel-previous"
        {...props}
      >
        {children ?? <ChevronIcon direction="left" />}
      </button>
    )
  }
)
CarouselPrevious.displayName = "CarouselPrevious"

const CarouselNext = React.forwardRef<HTMLButtonElement, CarouselArrowProps>(
  ({ className, children, ...props }, ref) => {
    const { index, count, goTo, disabled } = useCarousel("CarouselNext")

    return (
      <button
        ref={ref}
        type="button"
        aria-label="Next slide"
        disabled={disabled || count === 0 || index === count - 1}
        data-agent-part={usePart()}
        onClick={(event) => goTo(index + 1, personChange("arrow-press", event.nativeEvent))}
        className={cn(arrowClass, className)}
        data-slot="carousel-next"
        {...props}
      >
        {children ?? <ChevronIcon direction="right" />}
      </button>
    )
  }
)
CarouselNext.displayName = "CarouselNext"

const arrowClass =
  "rounded-lg border border-border p-1.5 text-foreground transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-35"

/** Inlined so the carousel installs with nothing but `motion`. */
function ChevronIcon({ direction }: { direction: "left" | "right" }) {
  return (
    <svg
      aria-hidden
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth={2}
      strokeLinecap="round"
      strokeLinejoin="round"
      className="h-4 w-4"
    >
      <path d={direction === "left" ? "M15 18l-6-6 6-6" : "M9 18l6-6-6-6"} />
    </svg>
  )
}

/** A slide's own name, without the "2 of 5: " its accessible name starts with. */
function slideName(node: HTMLElement | null | undefined, i: number) {
  const name = node?.getAttribute("aria-label") ?? ""
  const at = name.indexOf(": ")
  return at < 0 ? String(i + 1) : name.slice(at + 2)
}

function nearest(offsets: number[], target: number) {
  let closest = 0
  for (let i = 1; i < offsets.length; i += 1) {
    if (Math.abs(offsets[i] - target) < Math.abs(offsets[closest] - target)) {
      closest = i
    }
  }
  return closest
}

function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {
  return (value) => {
    for (const ref of refs) {
      if (typeof ref === "function") ref(value)
      else if (ref) (ref as React.RefObject<T | null>).current = value
    }
  }
}

export {
  Carousel,
  CarouselViewport,
  CarouselSlide,
  CarouselDots,
  CarouselPrevious,
  CarouselNext,
}
```
