Accordion With Live Media
A feature section pairing an accordion list of capabilities with a media panel that updates to match whichever row is active. Clicking a row opens it and swaps the adjacent image, good for a product tour that wants to pair short copy with a supporting screenshot or photo per point.
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/accordion-with-live-media.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/feature/feature71.tsx instead.
Usage
The file also exports feature71Demo, 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 { Feature71, feature71Demo } from "@/components/blocks/feature/feature71"; export default function Page() { return <Feature71 {...feature71Demo} />; }
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 | AccordionMediaItem[] | none | Accordion rows; each has its own title, description, and image. |
| className | string | none | Extra classes for the outer section element. |
Types
type AccordionMediaItem = { title: string; description: string; image: MediaSlotImage; // { src: string; alt: string } };
Behavior notes
- Real client-side state: clicking a row sets it active, which both expands its description and swaps the image shown in the side media panel (desktop) or inline beneath the open row (mobile, where the side panel is hidden).
- This copy-paste block ships with a static image slot via MediaSlot; the brief's 'image, video, or live component' media per row simplifies to image-only here, swap in your own video/embed by replacing the MediaSlot usage.
- Only one row is open at a time; there is no independent expand/collapse per row, opening a new row closes the previous one.
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.