Crossfading hero image slideshow with a progress pill, play/pause, and prev/next controls. A React + Motion component.
Installation
File Structure
Usage
Props
| Prop | Type | Default |
|---|---|---|
images? | HeroCarouselImage[] | - |
intervalMs? | number | 4500 |
initialIndex? | number | 0 |
className? | string | - |
classNames? | HeroCarouselClassNames | - |
HeroCarouselImage
| Prop | Type | Default |
|---|---|---|
src? | string | - |
alt? | string | - |
HeroCarouselClassNames
| Prop | Type | Default |
|---|---|---|
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: 7/26/2026
