Staaarter

Two-Tone Headers

Always-open FAQ cards where each question sits in a solid primary-colored header strip, clearly separated from a plain card-background content area holding the answer, for strong color-blocked visual separation.

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/two-tone-headers.json

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

Usage

The file also exports faq51Demo, 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 { Faq51, faq51Demo } from "@/components/blocks/faq/faq51";

export default function Page() {
  return <Faq51 {...faq51Demo} />;
}

Props

PropTypeDefaultDescription
badgestringnoneOptional small uppercase label above the heading.
headingstringnoneSection heading.
descriptionstringundefinedOptional supporting copy under the heading.
itemsQaItem[]noneQuestion and answer pairs, each rendered as a two-tone card.
classNamestringnoneExtra classes for the outer section element.

Types

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

Behavior notes

  • All cards are always open; there is no expand/collapse interaction.
  • The header strip uses bg-primary/text-primary-foreground and the content area uses bg-card, both semantic tokens so the color blocking still works across light and dark themes.
  • Purely presentational server component with no event handlers.