FAQ: two column
FAQ with an intro column and contact link beside the questions.
Preview
Answers slide open instead of snapping. Still native details/summary underneath. With reduced motion turned on, it renders the plain layout.
Is it free?
Yes, MIT licensed.
Do I need a package?
No, the code lands in your project.
Does it work with my theme?
Yes, it reads your shadcn tokens.
Is it free?
Yes, MIT licensed.
Do I need a package?
No, the code lands in your project.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { FaqTwoColumn } from "@/components/custom/faq-two-column";
<FaqTwoColumn
contact={{ label: "Email us", href: "mailto:hi@example.com" }}
items={[{ question: "Is it free?", answer: "Yes." }]}
/>import { FaqTwoColumnMotion } from "@/components/custom/faq-two-column/faq-two-column-motion";
<FaqTwoColumnMotion items={items} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items* (required) | { question; answer }[] | – | Questions in order. |
| contact | { label; href } | – | Link for anything not answered. |
| title | string | "Frequently asked questions" | Heading (h2). |
| description | string | – | Line under the heading. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| items* (required) | { question; answer }[] | – | Questions in order. |
| contact | { label; href } | – | Link for anything not answered. |
| title | string | "Frequently asked questions" | Heading (h2). |
| description | string | – | Line under the heading. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- Native details/summary: keyboard and screen-reader support with no JavaScript.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.