FAQ accordion
Questions on hairlines that open like they mean it: the answer eases to its height, the plus folds into a minus.
Used forLanding page FAQsPricing page questionsHelp centres and docsProduct and checkout pages
Install with the shadcn CLI
Registered the namespace? Then it’s shadcn add @hairline/faq-accordion. Set it up
Templates
Need the whole page?
63 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 8 are free.
Where it’s used
Landing page FAQs
The questions that stop visitors from signing up, answered in place.
Pricing page questions
Billing, refunds and plan limits next to the plans.
Help centres and docs
Short answers that expand without leaving the page.
Product and checkout pages
Shipping, returns and licence questions where people decide.
What it handles for you
The FAQ is where visitors decide, and most accordions jump open and slam shut. This one eases open to the answer’s real height and works properly with the keyboard.
It opens to the real height
The answer eases open to its own height, whatever its length, without measuring it first.
It closes without squeezing
The words fade first and then the space closes, so the text is never crushed.
One at a time, or many
In single mode, opening one question closes the other in the same motion. Choose which start open.
Answers can be anything
Text, links, lists or small tables. An answer is any React.
Keyboard navigation
Up and Down move between questions, and Home and End jump to the first and last.
Correct markup
Each question is a heading with a button that has aria-expanded, and closed answers are out of the tab order.
Overview
The FAQ is where visitors decide, and most accordions jump open and slam shut. Here the answer eases open to its real height while its text settles in out of a slight blur, and the plus turns half a circle as its upright folds flat into a minus. Closing fades the words first, then lets the space go. In single mode, opening one question closes the other in the same motion.
States
- closed
- The question at 80% ink on a hairline, with a plus; hover brings it to full.
- opening
- The answer’s row grows to its real height (460ms) and its text rises 6px out of a 4px blur; the plus turns 180° into a minus.
- closing
- The words fade in 160ms, then the space closes, so text never gets squeezed.
- single / multiple
- One open at a time, or any number.
Usage
In a FAQ section
Answers can be any React: links, lists, small tables.
Props
- items
- { question; answer; id? }[]
- Each question, and its answer as text or any React.
- type= "single"
- "single" | "multiple"
- One answer open at a time, or any number.
- defaultOpen= []
- number[]
- Questions open at first, by index.
Accessibility and motion
- Each question is a heading with a button (aria-expanded, aria-controls); each answer is a labelled region, hidden from the tab order when closed.
- Up and Down move between questions, Home and End jump to the first and last, as the ARIA accordion pattern describes.
- Height is animated with grid rows, so answers can be any length without measuring.
- With reduced motion, answers open and close in place.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
Source
Registry item: /r/faq-accordion.json


