Skip to content
VenusUI
Get started

3D Carousel

Cards arranged in a ring that turns in 3D, with buttons, arrow keys and announcements.

Preview

Installation

npx shadcn@latest add @venusui/carousel-3d

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/carousel-3d.tsx

Usage

The code behind the preview above.

carousel-3d-demo.tsx

import { Carousel3d } from "@/components/ui/carousel-3d"

const projects = ["Atlas", "Beacon", "Comet", "Delta", "Echo", "Flux"]

export default function Carousel3dDemo() {
  return (
    <Carousel3d
      label="Featured projects"
      items={projects.map((name, i) => ({
        id: name,
        label: name,
        content: (
          <div className="flex h-full flex-col justify-between p-5">
            <span className="font-mono text-xs text-muted-foreground">0{i + 1}</span>
            <span className="text-2xl font-semibold tracking-tight">{name}</span>
          </div>
        ),
      }))}
    />
  )
}

API reference

PropTypeDefaultDescription
items{ id: string; label: string; content: ReactNode }[]—Cards. label is announced when a card reaches the front. Required.
itemWidthnumber220Card width in pixels; the ring radius follows.
labelstring"Carousel"Accessible name, e.g. “Featured projects”.
classNamestring—Classes for the outer element.

Only the props above.

Requirements

  • lucide-react, React 19 and Tailwind CSS v4.

Customization

  • Five to eight cards look best; fewer make a flat ring.
  • Card height is h-60; change it in the file for taller content.

Accessibility

  • Follows the carousel pattern: a labelled region of slides, Previous/Next buttons, and the arrow keys when focused.
  • Only the front card can be focused; the others are inert. The front card’s label is announced.
  • With reduced motion the ring jumps instead of turning.

Troubleshooting

Cards overlap.
Increase itemWidth or use fewer items; the radius is calculated from both.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.

Loading preview

A card that tilts toward the pointer while its layers rise off the surface, each to its own depth.

Loading preview

A WebGL sphere of evenly spaced dots that slowly turns; drag or use the arrow keys to spin it.