Staaarter

Side-by-Side Image

A two-column layout pairing a large supporting image against a real accordion of questions and answers. The image side can flip to the left or right via a single prop, useful for alternating sections on a long page.

By Staaarter Team
FAQ
Docs
Live preview

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/side-by-side-image.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq13.tsx instead.

Usage

The file also exports faq13Demo, 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 { Faq13, faq13Demo } from "@/components/blocks/faq/faq13";

export default function Page() {
  return <Faq13 {...faq13Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Frequently asked questions"Section heading.
descriptionstringundefinedOptional supporting copy under the heading.
imageMediaSlotImagenoneLarge image shown in the image column.
imagePosition"left" | "right""left"Which side the image column renders on.
itemsFaq13Item[]noneOrdered list of question and answer entries in the accordion column.
classNamestringnoneExtra classes for the outer section element.

Types

type Faq13Item = { question: string; answer: string };

Behavior notes

  • Real interactivity: the accordion column is a genuine single-open-at-a-time accordion with aria-expanded/aria-controls buttons.
  • The image is a decorative MediaSlot at aspect-4/3, it is not clickable or otherwise interactive.
  • imagePosition flips which column the image renders in at the lg breakpoint via an order utility; below lg both columns stack with the image first regardless of the prop.
  • The first accordion item is open by default on initial render.