FAQ 1: accordion with heading
Frequently asked questions in an accessible accordion, with the heading and a help line in a side column on desktop.
// Ballmac UI: FAQ 1. https://ui.ballmac.com/blocks/faq-1
import * as React from "react"
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ballmac/accordion"
import { cn } from "@/lib/utils"
type Faq = { question: string; answer: string }
type Faq1Props = Omit<React.ComponentProps<"section">, "title"> & {
/** Section heading. */
title?: string
/** Text under the heading, e.g. where to get more help. */
description?: React.ReactNode
/** Questions and answers. */
items?: Faq[]
}
const defaults: Faq[] = [
{ question: "Is there a free plan?", answer: "Yes. The Hobby plan is free forever for personal projects, with no credit card required." },
{ question: "Can I change plans later?", answer: "Anytime. Upgrades take effect immediately; downgrades apply at the end of your billing period." },
{ question: "Do you offer refunds?", answer: "If you're not happy within 14 days of upgrading, contact support for a full refund." },
{ question: "Where is my data stored?", answer: "In the region you choose when you create a project. You can export everything at any time." },
{ question: "Do you support single sign-on?", answer: "SAML SSO is available on the Pro plan and above." },
]
function Faq1({
title = "Frequently asked questions",
description = "Can't find what you're looking for? Contact our support team.",
items = defaults,
className,
...props
}: Faq1Props) {
return (
<section data-slot="faq-1" className={cn("mx-auto grid max-w-6xl gap-10 px-4 py-20 sm:px-6 md:py-28 lg:grid-cols-[1fr_1.6fr]", className)} {...props}>
<div>
<h2 className="text-3xl font-semibold tracking-[-0.035em] text-balance sm:text-4xl">{title}</h2>
<p className="mt-4 text-muted-foreground">{description}</p>
</div>
<Accordion type="single" collapsible defaultValue="item-0">
{items.map((item, i) => (
<AccordionItem key={item.question} value={`item-${i}`}>
<AccordionTrigger>{item.question}</AccordionTrigger>
<AccordionContent>{item.answer}</AccordionContent>
</AccordionItem>
))}
</Accordion>
</section>
)
}
export { Faq1, type Faq1Props }Installation
$ pnpm dlx shadcn@latest add @ballmac/faq-1Add the Ballmac items it builds on.
$ pnpm dlx shadcn@latest add @ballmac/accordionCopy the source into your project.
components/ballmac/blocks/faq-1/faq-1.tsx// Ballmac UI: FAQ 1. https://ui.ballmac.com/blocks/faq-1 import * as React from "react" import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ballmac/accordion" import { cn } from "@/lib/utils" type Faq = { question: string; answer: string } type Faq1Props = Omit<React.ComponentProps<"section">, "title"> & { /** Section heading. */ title?: string /** Text under the heading, e.g. where to get more help. */ description?: React.ReactNode /** Questions and answers. */ items?: Faq[] } const defaults: Faq[] = [ { question: "Is there a free plan?", answer: "Yes. The Hobby plan is free forever for personal projects, with no credit card required." }, { question: "Can I change plans later?", answer: "Anytime. Upgrades take effect immediately; downgrades apply at the end of your billing period." }, { question: "Do you offer refunds?", answer: "If you're not happy within 14 days of upgrading, contact support for a full refund." }, { question: "Where is my data stored?", answer: "In the region you choose when you create a project. You can export everything at any time." }, { question: "Do you support single sign-on?", answer: "SAML SSO is available on the Pro plan and above." }, ] function Faq1({ title = "Frequently asked questions", description = "Can't find what you're looking for? Contact our support team.", items = defaults, className, ...props }: Faq1Props) { return ( <section data-slot="faq-1" className={cn("mx-auto grid max-w-6xl gap-10 px-4 py-20 sm:px-6 md:py-28 lg:grid-cols-[1fr_1.6fr]", className)} {...props}> <div> <h2 className="text-3xl font-semibold tracking-[-0.035em] text-balance sm:text-4xl">{title}</h2> <p className="mt-4 text-muted-foreground">{description}</p> </div> <Accordion type="single" collapsible defaultValue="item-0"> {items.map((item, i) => ( <AccordionItem key={item.question} value={`item-${i}`}> <AccordionTrigger>{item.question}</AccordionTrigger> <AccordionContent>{item.answer}</AccordionContent> </AccordionItem> ))} </Accordion> </section> ) } export { Faq1, type Faq1Props }Update the import paths to match your project setup.
Usage
import { Faq1 } from "@/components/ballmac/blocks/faq-1/faq-1"
export default function Faq1Demo() {
return <Faq1 />
}States
This block has no states. Static content: nothing to load, submit or fail.
Quality scorecard
Every applicable check passes
Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 1 example.
Passed: Accessibility scan
No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).
Passed: Small screens
No sideways scrolling at 360, 390 or 1280 px wide.
Passed: Reduced motion
No endless animation to begin with.
Passed: Right to left
Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (0% of elements off the mirror, limit 15%).
Passed: Clean console
No console errors or React hydration errors while loading.
Passed: Keyboard
5 tab stops, each showing a visible change when it takes focus.
Not applicable: Loading, empty and error
Static content: nothing to load, submit or fail.
For information: Automated tests
No test file of its own yet.
For information: Footprint
1.1 KB of source (gzip) in 1 file. No extra npm packages.
Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.
Dependencies
- npm
- None
- Registry
- @ballmac/accordionshadcn/utils
Use with AI
An FAQ section. Pass items=[{ question, answer }]; the first answer starts open. With the shadcn MCP server set up (guide), ask your agent:
Add the Ballmac UI FAQ 1: accordion with heading (@ballmac/faq-1) to this project with the shadcn MCP, then use it where it fits.
Use it for
- Pricing pages and landing pages
- Support and onboarding pages
Not for
- Long documentation (use a docs page)
Registry JSON: https://ui.ballmac.com/r/faq-1.json
Free to use in personal and commercial projects.
More faq blocks
FAQ 2: searchable with topic filters
Frequently asked questions with live search that highlights matches, topic filters with counts, a friendly empty state and a support prompt. Topics scroll sideways on phones.
Faq Pro 1: searchable FAQ with highlights
A search box that filters questions and highlights the match, topic chips and an accordion. A friendly empty state links to support.
Faq Pro 2: helpful votes and support card
An accordion where each answer asks Was this helpful, next to a sticky support card with chat and email.
Ballmac UI Pro
Need the whole screen, not one piece?
311 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.
Not ready? Try three Pro blocks free
Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.