Ambient Strip
A horizontal strip of portrait frames that expands the hovered or focused card while a blurred, full-bleed version of the same artwork crossfades behind the row. Drag, wheel, or use the arrow keys to travel the strip; touch devices expand whichever card sits at the center.
Installation#
pnpm dlx shadcn@latest add @davinciui/ambient-stripUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
itemsFrames in the strip. Each item needs src and can define type ('image' | 'video'), poster, title, subtitle, tone, and alt. | AmbientStripItem[] | — |
cardWidthIdle card width in pixels. "auto" keeps roughly four frames visible on desktop and snaps to a wider single-frame focus on small screens. | number | "auto" | "auto" |
expandScaleHow much taller the active frame grows when it is hovered, focused, or centered. | number | 1.18 |
gapSpace between frames in CSS pixels. | number | 14 |
blurBackdrop blur radius for the full-bleed ambient layer, in CSS pixels. | number | 72 |
loopRepeat the strip seamlessly, keeping one tiled set of frames focusable for keyboard users. | boolean | true |
restColorOverride the flat surface behind the strip. Defaults to light gray in light mode and near-black in dark mode. | string | "theme surface" |
activeIndexControlled active frame. When provided, the strip scrolls that frame toward the center and ignores hover, focus, and center-snap. Pass null to show the rest state. | number | null | — |
badgeOptional pill rendered in the bottom-right corner for hints or metadata. | ReactNode | — |
onActiveChangeCalled with the active item index whenever the expanded frame changes, or null when nothing is active. | (index: number | null) => void | — |
classNameAdditional classes for the host section, including its minimum height. | string | — |
Accessibility#
Each frame is a labelled group with a screen-reader caption built from its title and subtitle (falling back to alt). Only one tiled set stays in the tab order, arrow keys move between frames, and focus outlines stay visible against the ambient artwork.
Motion#
Expansion and ambient crossfades use spring and ease-out motion. When the user prefers reduced motion, transitions shorten to near-instant fades and the ambient drift is disabled.
Customization#
Drive layout through cardWidth, gap, and expandScale. Use restColor for the flat surface behind the strip and blur for the ambient backdrop; className handles the host section, including its minimum height.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

