Staaarter

Horizontal Split View

An interview-style FAQ layout with a column of question buttons on the left and a single answer panel on the right. Clicking a question swaps the panel's content to that item's answer, with the first question selected by default, so only one full answer is ever on screen at a time.

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 dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/horizontal-split-view.json

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

Usage

The file also exports faq47Demo, 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 { Faq47, faq47Demo } from "@/components/blocks/faq/faq47";

export default function Page() {
  return <Faq47 {...faq47Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Frequently asked questions"Section heading.
descriptionstringnoneOptional supporting copy under the heading.
faqsFaqSplitItem[]noneList of question/answer pairs, question 0 selected initially.
classNamestringnoneExtra classes for the outer section element.

Types

interface FaqSplitItem {
  question: string;
  answer: string;
}

Behavior notes

  • Real client behavior: a selectedIndex state (defaulting to 0) tracks which question is active; clicking a left-column button updates it and swaps the right panel's content.
  • Only one answer is ever rendered on the right at a time, aria-pressed on the buttons reflects the current selection.