# Faq 6

> Header and button beside an accordion; optional numbering (from Marbrook)

A shadcn/ui block from the [@cnippet-blocks](https://blocks.cnippet.dev/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet-blocks/faq-6).

- Page, with a live preview: https://shadcn.exchange/r/cnippet-blocks/faq-6
- Screenshot: https://shadcn.exchange/shot/cnippet-blocks/faq-6/light.png
- Registry item: https://blocks.cnippet.dev/r/faq-6.json
- Categories: faq
- Listed: 2026-11-01, source last changed 2026-11-01

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet-blocks/faq-6.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- npm packages: `lucide-react`
- Registry items: `@cnippet/accordion`, `@cnippet/button`, `@cnippet/utils`

## Files

### `registry/default/sections/faq-6/index.tsx`

```tsx
"use client";

import { Minus, Plus } from "lucide-react";
import Link from "next/link";

import {
  Accordion,
  AccordionItem,
  AccordionPanel,
  AccordionTrigger,
} from "@/components/ui/accordion";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";

import type { Surface } from "../_types/common";
import type { FaqContent } from "../_types/faq";
import { defaultFaq6Content } from "./data";
import { SectionHeader, surfaceClass, toneFor } from "./section-header";

const tones = {
  dark: {
    answer: "text-primary-foreground/60",
    border: "border-primary-foreground/10",
    icon: "border-primary-foreground/20 text-secondary",
    number: "text-primary-foreground/35",
    question: "text-primary-foreground",
  },
  light: {
    answer: "text-muted-foreground",
    border: "border-border",
    icon: "border-input text-primary",
    number: "text-muted-foreground/70",
    question: "text-primary",
  },
};

/** Header and an optional button in a narrow column beside an accordion.
 *  `numbered` prefixes each question with its two-digit index, which turns
 *  it into a list of principles or reasons. */
export default function Faq6({
  content = defaultFaq6Content,
  numbered = false,
  surface = "default",
}: {
  content?: FaqContent;
  numbered?: boolean;
  surface?: Surface;
}) {
  const t = surface === "primary" ? tones.dark : tones.light;

  return (
    <section className={cn("py-20 sm:py-28", surfaceClass[surface])}>
      <div className="mx-auto max-w-7xl px-5 sm:px-8 lg:px-12">
        <div className="grid gap-12 lg:grid-cols-12 lg:gap-16">
          <div className="lg:col-span-4">
            <SectionHeader
              description={content.description}
              eyebrow={content.eyebrow}
              size="sm"
              title={content.title}
              tone={toneFor(surface)}
            />
            {content.action && (
              <Button
                className="mt-8 border-input bg-background px-7 text-primary shadow-none before:shadow-none hover:bg-muted"
                render={<Link href={content.action.href} />}
                size="xl"
                variant="outline"
              >
                {content.action.label}
              </Button>
            )}
          </div>

          <div className="lg:col-span-8">
            <Accordion
              className={cn("border-t", t.border)}
              defaultValue={content.items[0] ? [content.items[0].id] : []}
            >
              {content.items.map((item, index) => (
                <AccordionItem
                  className={cn("border-b last:border-b-0", t.border)}
                  key={item.id}
                  value={item.id}
                >
                  <AccordionTrigger
                    className="items-center gap-6 py-6 text-left font-normal [&:not([data-panel-open])_[data-icon=minus]]:hidden [&[data-panel-open]_[data-icon=plus]]:hidden"
                    icon={
                      <span
                        className={cn(
                          "flex size-8 shrink-0 items-center justify-center rounded-md border",
                          t.icon,
                        )}
                      >
                        <Plus className="size-4" data-icon="plus" />
                        <Minus className="size-4" data-icon="minus" />
                      </span>
                    }
                  >
                    <span className="flex items-baseline gap-5">
                      {numbered && (
                        <span className={cn("font-mono text-xs", t.number)}>
                          {String(index + 1).padStart(2, "0")}
                        </span>
                      )}
                      <span
                        className={cn(
                          "font-display text-xl sm:text-2xl",
                          t.question,
                        )}
                      >
                        {item.question}
                      </span>
                    </span>
                  </AccordionTrigger>
                  <AccordionPanel
                    className={cn(
                      "max-w-2xl pb-7 text-sm leading-relaxed",
                      numbered && "pl-11",
                      t.answer,
                    )}
                  >
                    {item.answer}
                  </AccordionPanel>
                </AccordionItem>
              ))}
            </Accordion>
          </div>
        </div>
      </div>
    </section>
  );
}
```

### `registry/default/sections/faq-6/data.ts`

```ts
import type { FaqContent } from "../_types/faq";

export const defaultFaq6Content: FaqContent = {
  action: {
    href: "/contact",
    label: "Ask a question",
  },
  description:
    "The things people ask us most. Anything else, the phone is answered by a person.",
  eyebrow: "Questions",
  items: [
    {
      answer:
        "No. Registering costs nothing and puts you on the private list — you will hear about matching homes, usually a week or two before they are advertised publicly.",
      id: "registration",
      question: "Do I pay anything to register as a buyer?",
    },
    {
      answer:
        "A valuation visit takes about forty minutes and is free of charge. You will get a written range within two working days, with the three comparable sales it is based on.",
      id: "valuation",
      question: "How does the free valuation work?",
    },
    {
      answer:
        "Sales commission is 1.4% of the achieved price, plus VAT, payable on completion. Photography, floor plans, and the film are included — there are no marketing add-ons.",
      id: "fees",
      question: "What are your fees for selling?",
    },
    {
      answer:
        "Yes. Around a third of our stock is handled discreetly, with no board, no portal listing, and viewings by appointment only. It suits sellers who would rather not advertise a move.",
      id: "off-market",
      question: "Can I sell without a public listing?",
    },
    {
      answer:
        "We manage 260 tenancies in-house — referencing, deposits, inspections, and maintenance. Reporting arrives monthly and you keep a single named contact.",
      id: "management",
      question: "Do you manage rentals as well as let them?",
    },
    {
      answer:
        "Most purchases complete in eight to twelve weeks from an accepted offer. Chain-free and cash purchases have completed in under four.",
      id: "timeline",
      question: "How long does a purchase usually take?",
    },
  ],
  title: "Before you call",
};
```

### `registry/default/sections/faq-6/section-header.tsx`

```tsx
import type React from "react";

import { cn } from "@/lib/utils";

import type { Surface } from "../_types/common";

/** The small uppercase label that opens most headers. */
export const eyebrowClass =
  "inline-flex items-center gap-2 font-medium text-[0.6875rem] uppercase tracking-[0.22em]";

export const surfaceClass: Record<Surface, string> = {
  default: "bg-background text-foreground",
  muted: "bg-muted text-foreground",
  primary: "bg-primary text-primary-foreground",
  secondary: "bg-secondary text-secondary-foreground",
};

/**
 * Which band the header sits on. `photo` keeps literal white, because
 * `--primary-foreground` inverts in dark mode and would be unreadable over a
 * photograph.
 */
export type SectionTone = "light" | "photo" | "primary" | "secondary";

export function toneFor(surface: Surface): SectionTone {
  if (surface === "primary") return "primary";
  if (surface === "secondary") return "secondary";
  return "light";
}

const toneClasses: Record<
  SectionTone,
  { eyebrow: string; heading: string; lede: string; tick: string }
> = {
  light: {
    eyebrow: "text-muted-foreground/70",
    heading: "text-primary",
    lede: "text-muted-foreground",
    tick: "bg-secondary",
  },
  photo: {
    eyebrow: "text-white/50",
    heading: "text-white",
    lede: "text-white/65",
    tick: "bg-secondary",
  },
  primary: {
    eyebrow: "text-primary-foreground/40",
    heading: "text-primary-foreground",
    lede: "text-primary-foreground/60",
    tick: "bg-secondary",
  },
  secondary: {
    eyebrow: "text-secondary-foreground/50",
    heading: "text-secondary-foreground",
    lede: "text-secondary-foreground/70",
    tick: "bg-primary",
  },
};

export function SectionHeader({
  action,
  actionAt = "sm",
  className,
  description,
  eyebrow,
  size = "default",
  title,
  tone = "light",
}: {
  /** Rendered beside the heading block once `actionAt` is reached. */
  action?: React.ReactNode;
  /** A text link fits from `sm`; a row of filter tabs needs `lg`. */
  actionAt?: "lg" | "sm";
  className?: string;
  description?: React.ReactNode;
  eyebrow: string;
  /** `sm` is the narrow-sidebar size used by 4/8 splits. */
  size?: "default" | "sm";
  title: React.ReactNode;
  tone?: SectionTone;
}): React.ReactElement {
  const tones = toneClasses[tone];

  return (
    <div
      className={cn(
        action && "flex flex-col gap-6",
        action &&
          (actionAt === "lg"
            ? "gap-8 lg:flex-row lg:items-end lg:justify-between"
            : "sm:flex-row sm:items-end sm:justify-between"),
        className,
      )}
    >
      <div className={cn(action && "max-w-xl")}>
        <p className={cn(eyebrowClass, tones.eyebrow)}>
          <span className={cn("size-1", tones.tick)} />
          {eyebrow}
        </p>

        <h2
          className={cn(
            "mt-5 font-display",
            tones.heading,
            size === "sm"
              ? "text-3xl leading-[1.1] sm:text-4xl"
              : "text-4xl leading-[1.05] sm:text-5xl",
          )}
        >
          {title}
        </h2>

        {description && (
          <p className={cn("mt-4 max-w-xl leading-relaxed", tones.lede)}>
            {description}
          </p>
        )}
      </div>

      {action}
    </div>
  );
}
```

### `registry/default/sections/_types/common.ts`

```ts
/**
 * Shapes shared by every token-based section. Each section ships this file
 * alongside its own category types, so installing several sections simply
 * rewrites the same file.
 */

/** Which band a section sits on. A style choice, never part of `content`. */
export type Surface = "default" | "muted" | "primary" | "secondary";

export type ImageAsset = {
  alt: string;
  src: string;
};

export type LinkAction = {
  href: string;
  label: string;
};

/** Eyebrow + heading + optional lede, the header most sections open with. */
export type SectionIntro = {
  description?: string;
  eyebrow: string;
  title: string;
};

/** A figure that counts up when it scrolls into view. */
export type Stat = {
  decimals?: number;
  label: string;
  prefix?: string;
  suffix?: string;
  value: number;
};

/** A figure that is displayed as written ("1,240+", "4.9/5"). */
export type Highlight = {
  label: string;
  value: string;
};

export type FormField = {
  label: string;
  name: string;
  /** Only for `type: "select"`. The first option is the default. */
  options?: string[];
  placeholder?: string;
  required?: boolean;
  /** `full` spans both columns of a two-column form. */
  span?: "full" | "half";
  type?: "email" | "select" | "tel" | "text" | "textarea";
};

export type FormContent = {
  description?: string;
  fields: FormField[];
  note?: string;
  submitLabel: string;
  success: {
    description: string;
    resetLabel: string;
    title: string;
  };
  title: string;
};
```

### `registry/default/sections/_types/faq.ts`

```ts
import type { LinkAction, SectionIntro } from "./common";

export type FaqContent = SectionIntro & {
  action?: LinkAction;
  items: {
    answer: string;
    id: string;
    question: string;
  }[];
};
```
