Sora UI

Hero Carousel

Crossfading hero image slideshow with a progress pill, play/pause, and prev/next controls. A React + Motion component.

Loading...

Hero image slideshow cycling through a set of project preview screenshots.

Installation

npx shadcn@latest add @soralabs/hero-carousel

File Structure

hero-carousel.tsx
use-prefers-reduced-motion.tsx

Usage

Props

PropTypeDefault
images?
HeroCarouselImage[]
-
intervalMs?
number
4500
initialIndex?
number
0
className?
string
-
classNames?
HeroCarouselClassNames
-

HeroCarouselImage

PropTypeDefault
src?
string
-
alt?
string
-

HeroCarouselClassNames

PropTypeDefault
pill?
string
-
chevron?
string
-

When to Use

Use HeroCarousel for a portfolio or landing-page hero that cycles through project screenshots without stealing focus — the crossfade is slow and blurred, the progress pill doubles as a pause/resume toggle, and clicking the image itself advances to the next slide.

Accessibility

The current slide's alt text is applied to the visible image; the buffered layer underneath is aria-hidden. The play/pause pill exposes aria-pressed and swaps its aria-label between "Pause slideshow" and "Play slideshow". Left/Right arrow keys step through slides when focus isn't in a text input. When prefers-reduced-motion: reduce is set, slides swap instantly (no blur, scale, or crossfade) and the progress pill still advances slides on the same interval, just without a visible countdown fill.

Built by Axyl. A motion-first component registry for React.

Last updated: 9/14/2026

On this page

Help keep SoraLabs moving.

Every contribution helps us build and maintain open-source tools for the community.

Sponsor on GitHub