Feature with Image Carousel and Lightbox Modal
A centered header followed by a side-by-side image carousel (three items visible on desktop, two on tablet, one on mobile) with prev/next arrows and dot pagination. Tapping an item opens a full-size modal lightbox with its own prev/next navigation.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/feature-carousel-lightbox.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/feature/feature63.tsx instead.
Usage
The file also exports feature63Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Feature63, feature63Demo } from "@/components/blocks/feature/feature63"; export default function Page() { return <Feature63 {...feature63Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | none | Small label above the heading. |
| heading | ReactNode | none | Section heading. |
| description | string | none | Supporting copy under the heading. |
| items | CarouselItem[] | none | Carousel items, rendered in array order. |
| className | string | none | Extra classes for the outer section element. |
Types
type CarouselItem = { image: MediaSlotImage; caption?: string; };
Behavior notes
- Real client-side state: the carousel is a native horizontally-scrolling, scroll-snapped track; the prev/next arrows scroll it by exactly one item's width, and the dots scroll directly to a given item.
- The active dot is derived from the track's scroll position via a real onScroll handler that finds the item closest to the current scroll offset, so it stays in sync with manual swiping as well as the arrow buttons.
- Clicking any carousel item opens a fixed-position modal lightbox at that item's index with its own close, previous, and next controls; Escape closes it and the left/right arrow keys navigate it, wired via a real keydown listener while it is open.
- The carousel item width is `w-full` on mobile, `sm:w-1/2` on tablet, and `lg:w-1/3` on desktop, matching one, two, and three visible items respectively.
- The lightbox is a plain fixed-position overlay (no portal library), rendered conditionally in the same component tree.
More Feature Blocks
View all →Full-Bleed Workspace Band
Two-column header above a full-bleed image band with a live view switcher, closing on three numbered captions.
Center-Line Journey Timeline
Vertical hairline timeline alternating stages either side, dropping a phone frame on one step.
Figure-Led Evidence Rows
Tall image with a floating before-and-after card, leading into oversized-figure evidence rows.
Staircase Asset Trio
Three image tiles stepping down the page in a staircase, each floating a different live asset.
Sticky Reference List
Sticky heading column beside three labelled groups of checked capabilities, closing on a footnote.
Day Timeline Rows
Hairline rows walking through one working day, stamped with time and a live approval card inline.