React Card Carousel

A horizontal slider of full-bleed image cards — an eyebrow, a headline, and a "Learn more" over a dark scrim on each. It uses native scroll-snap, so it swipes on touch and works without JavaScript for scrolling; the prev/next arrows and the pill-dot pagination below drive it and track position. Three cards show on desktop, fewer as the screen narrows. Drag it, or use the arrows and dots.

Installation

npx shadcn@latest add card-carousel.json

Props

PropTypeDefaultDescription
titlestringSection heading
eyebrow / subtitlestringKicker + intro paragraph
action{ label, href? }Outline CTA under the header
cardsCarouselCard[]{ image?, eyebrow?, title, cta?, href? }

Each card's image should be an <img className="absolute inset-0 h-full w-full object-cover"> so it fills the card behind the scrim and overlaid text.