Component docs
Loading
"use client";
import { Carousel } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly ReactNode[] | — | Items to render. |
defaultValue | number | — | Initial value when uncontrolled. |
nextLabel | string | — | — |
onValueChange | (value: number) => void | — | Called with the new value (only when it changes). |
previousLabel | string | — | — |
value | number | — | Current value (controlled); null where it means "nothing selected". |
itemsrequiredreadonly ReactNode[]
Items to render.
defaultValuenumber
Initial value when uncontrolled.
nextLabelstring
onValueChange(value: number) => void
Called with the new value (only when it changes).
previousLabelstring
valuenumber
Current value (controlled); null where it means "nothing selected".
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const slides = [<p key="one">First slide</p>, <p key="two">Second slide</p>];
<Carousel items={slides} />