Search documentation

Search the documentation and open a page.

A carousel for browsing a collection of content one or more items at a time.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/carousel

Composition

Carousel ├── CarouselContent │ └── CarouselItem ├── CarouselControl │ ├── CarouselPrevious │ └── CarouselNext ├── CarouselIndicators | CarouselIndicatorGroup (optional) │ └── CarouselIndicator └── CarouselAutoplayTrigger (optional)

Examples

Default

Loading...
Loading...

In A Card

Loading...

Multiple Items

Loading...

Vertical

Loading...

With Indicators

Loading...

API Reference

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
translationsIntlTranslations | undefined—Configures translations.
slidesPerPagenumber | undefined—Configures slides per page.
autoSizeboolean | undefined—Configures auto size.
slidesPerMovenumber | "auto" | undefined—Configures slides per move.
autoplayboolean | { delay: number—Configures autoplay.
allowMouseDragboolean | undefined—Configures allow mouse drag.
loopboolean | undefinedfalseLoops keyboard or carousel navigation at the ends.
pagenumber | undefined—Configures page.
defaultPagenumber | undefined—Configures default page.
spacingstring | undefined—Configures spacing.
paddingstring | undefined—Configures padding.
onPageChange((details: PageChangeDetails) => void) | undefined—Runs when page changes.
inViewThresholdnumber | number[] | undefined—Configures in view threshold.
snapType"proximity" | "mandatory" | undefined—Configures snap type.
onDragStatusChange((details: DragStatusDetails) => void) | undefined—Runs when drag status changes.
onAutoplayStatusChange((details: AutoplayStatusDetails) => void) | undefined—Runs when autoplay status changes.

Context, Hooks, and Types

ExportAPI
CarouselContextRender-prop component that exposes component state and actions.
CarouselRootProviderProvides an externally created API to the component tree.
useCarouselCreates or accesses the component API.
useCarouselContextReturns the nearest component API.