FAQ
Shown as Folio, a made-up product
A help centre for a mail-in film lab: search that highlights every match, topics with live counts, answers grouped in a calm accordion and a person at the lab for anything else.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/folio-faq.json?token=…"Adds the piece to components/propui/08-folio-faq/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A help centre or FAQ page with a dozen or more answers people search rather than read in order.
- Answers grouped by topic, with prices and times that need to agree across questions.
- An FAQ that hands off to a real person when the answers don't cover the question.
Something else fits when
- Three to five questions under a pricing table: a plain accordion is enough.
- A full documentation site with long articles: use pages with their own navigation.
- Release notes or a changelog: Release notes is built for dated releases.
Usage
A section in normal page flow.
import Piece from "@/components/propui/08-folio-faq/Section";
export default function Page() {
return <Piece />;
}Replace items and topics in data.ts with your questions, and the name, nav, POPULAR searches and the contact in Section.tsx. Topic counts, the tally and the groups are computed from items.
Your data
Replace these and everything on screen follows.
items{ id; question; answer; topic }[]- Every question and its plain-text answer; search matches against both.
topicsFolioTopic[]- The topic list in the side column and the order of the groups.
FolioTopicstring union- The topic names; add one here, in topics and in TOPIC_ICON in Section.tsx.
POPULARstring[]- The popular searches under the search field (in Section.tsx).
Interactions
- Open or close any answer; Expand all and Collapse all work on the answers shown.
- Type in the search to filter and highlight matches; every match opens so the highlighted words show.
- Pick a popular search, or a topic to show only its answers.
- Answer Was this helpful? under any answer.
- Ask the lab, or Ask Wren this when nothing matches, to send the question to a person.
Keyboard
- ↑or↓
- Move between questions.
- HomeorEnd
- Jump to the first or last question.
- EnterorSpace
- Open or close the focused answer.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Each question is a button inside an h3 with aria-expanded and aria-controls; each answer is a region labelled by its question.
- A closed answer is inert, so it can't be tabbed into or read out.
- The tally of answers shown and the reply under Wren are polite live regions.
- Topic buttons use aria-pressed; topics with no matches are disabled.
- Search matches are marked with mark elements, not colour alone.
Motion
- Answers open on the grid row track (0fr to 1fr) with a fade, so the height eases without measuring.
- The topic pill glides to the chosen topic on a spring; the answers fade up when the topic changes.
- The plus turns into a minus and its circle fills when an answer opens.
- Reduced motion makes every height, fade and glide instant.
Responsive
- At 960px and below the side column stops being sticky and sits above the answers, and the topics wrap into a row of chips.
- At 640px and below the nav links hide, the title and questions step down a size and answers use the full width.
Performance
- No measuring: opening an answer is a CSS grid transition, not a height animation in script.
- No images: inline SVG icons and one local font file.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep answers as plain text in data.ts; search and highlighting depend on it.
- When a price changes, change it in every answer that mentions it so the figures still agree.
- Every class is prefixed fo- and scoped under .fo; keep colours in the tokens at the top of post.css.
/p/folio-faq/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.