Carousel: HextaUI and shadcn/ui

The HextaUI Carousel keeps the shadcn/ui names and theme tokens and installs with the same CLI. This page lists what differs, read from the source of both. The shadcn/ui side is its base-vega registry as of 2026-10-16.

At a glance

MeasureHextaUIshadcn/ui
Exported parts105
Props the wrapper handles238
Lines of source1667256
npm dependencies@base-ui/react@^1.8.0@tabler/icons-reactclass-variance-authoritycncnembla-carousel-react
Built frombuttonnumber-flowthemebutton

More source is not better on its own. Most of the extra lines in HextaUI handle states, motion and edge cases that you would otherwise write yourself.

Parts

Only in HextaUICarouselDotsCarouselCounterCarouselAutoplayToggleCarouselThumbnailsCarouselThumbnail

In bothCarouselCarouselContentCarouselItemCarouselPreviousCarouselNext

Props HextaUI adds

Props the HextaUI wrapper handles itself that the shadcn/ui wrapper does not. Props passed straight through to Base UI or the underlying library are left out, because both versions accept them.

PropWhat it does
defaultIndexCarouselSee the API reference
rewindCarouselWrap from the last slide back to the first.
mouseDragCarouselLet a mouse drag the slides.
autoplayCarouselAdvance on a timer. delay defaults to 5000ms, minimum 1000ms.
viewportClassNameCarouselContentApplied to the scrolling viewport.
variantCarouselAutoplayToggleSee the API reference

Variants

PropIn bothOnly HextaUIOnly shadcn/ui
spacingCarousel–nonesmdefaultlg–
orientationCarouselNav–horizontalvertical–
directionCarouselNav–previousnext–

The HextaUI version

import {
  Carousel,
  CarouselContent,
  CarouselDots,
  CarouselItem,
  CarouselNext,
  CarouselPrevious,
} from "@/components/ui/carousel"

const slides = [1, 2, 3, 4, 5]

export function CarouselDemo() {
  return (
    <div className="w-full max-w-xs px-12">
      <Carousel aria-label="Numbers">
        <CarouselContent>
          {slides.map((value) => (
            <CarouselItem key={value}>
              <div className="flex aspect-square items-center justify-center rounded-xl border bg-card p-6 text-4xl font-semibold">
                {value}
              </div>
            </CarouselItem>
          ))}
        </CarouselContent>
        <CarouselPrevious />
        <CarouselNext />
        <div className="mt-3 flex justify-center">
          <CarouselDots />
        </div>
      </Carousel>
    </div>
  )
}

Every state, the keyboard map and the API reference are on the component page.

13 of its examples also have a page of their own.

Switch one component

Run the add command with --overwrite to replace the shadcn/ui file in @/components/ui, then review the diff in git before you keep it. Imports stay the same, and components you don’t replace keep working.

pnpm dlx shadcn@latest add https://hextaui.com/r/carousel.json --overwrite
  • Every prop in the table above is an addition, so call sites written for shadcn/ui don’t pass it yet.
  • Check any part or variant listed only for shadcn/ui before you switch, and map it to the closest HextaUI one.

Other components compared

More comparisons