Skip to content

FAQ by category in React

Questions grouped under subheadings, for long FAQs.

Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in React

CategorizedFaq.tsx
export function CategorizedFaq() {
  return (
    <div className="mx-auto w-[min(100%_-_2rem,46rem)] py-8">
      <section>
        <h2 className="mb-6 font-serif text-4xl">Questions fréquentes</h2>
        <div className="not-first-of-type:mt-8">
          <h3 className="mb-2 font-bold text-[#9f2d20] dark:text-[#f2a38f]">Réservations</h3>
          <details className="group border-t border-[#e3d3c3] last:border-b dark:border-[#4a3328]">
            <summary className="relative cursor-pointer list-none py-4 pr-8 font-semibold after:absolute after:top-3 after:right-1 after:text-2xl after:leading-none after:text-[#9f2d20] after:content-['+'] group-open:after:content-['−'] focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-[#9f2d20] dark:after:text-[#f2a38f] dark:focus-visible:outline-[#f2a38f] [&::-webkit-details-marker]:hidden">
              Faut-il réserver ?
            </summary>
            <p className="pb-4.5 leading-relaxed text-[#6b4434] dark:text-[#d9b8a6]">

Free component: copy it freely, including for commercial projects.

FAQ and accordions components in React
  • A native accordion FAQ where each answer asks “Was this answer helpful?”, with a thank-you message and a remembered vote.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An introduction and a contact link on the left, expandable questions on the right.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A tight accordion within a single frame, for practical information pages.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • All answers visible at once, presented as a card grid.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Frequently asked questions followed by a card inviting visitors to call or write.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Questions that expand one by one, with FAQPage structured data for Google.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component