Carousel
Uses Embla Carousel for scroll position and dragging while neumorphism is limited to the slide surfaces and controls. Previous and next buttons disable automatically at the ends.
@neumorphism-ui/carouselPreview
Dashboard
Settings
Analytics
Installation
Installation: carousel
npx shadcn@latest add @neumorphism-ui/carouselThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Import
Carousel import code
"use client";
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";Example
Carousel usage code
export default function Example() {
return <Carousel aria-label="Feature tour" className="w-full max-w-md px-12">
<CarouselContent>
{["Dashboard", "Settings", "Analytics"].map((item) => <CarouselItem key={item}><div className="grid h-40 place-items-center rounded-[var(--neu-radius-surface)] border border-[var(--neu-edge)] bg-[var(--neu-surface)] [box-shadow:var(--neu-shadow-raised-sm)]">{item}</div></CarouselItem>)}
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>;
}API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Carousel | orientation | "horizontal" | "vertical" | "horizontal" | Sets the scroll axis and matching arrow-key behavior. |
Carousel | opts | EmblaOptionsType | — | Passes Embla options such as loop and align. |
Carousel | setApi | (api: CarouselApi) => void | — | Provides the Embla API instance for external integrations. |
CarouselItem | children | ReactNode | — | Contains the real content of one slide. |
CarouselPrevious / CarouselNext | label | string | — | Localizes the accessible name of the previous and next buttons. |
Accessibility
- 01
Give Carousel an aria-label or aria-labelledby that identifies the region.
- 02
Slides use group semantics with a carousel slide description, while navigation buttons expose disabled state at the ends.
- 03
Horizontal carousels support Left and Right; vertical carousels support Up and Down.