All-Access · 26 templates$1636.97$99/year — save 93%Get access
  • HomeHome
  • TemplatesTemplates28
  • ComponentsComponents78
  • PricingPricing
  • BlogBlog
  • Need a Website?Need a Website?New
Unlock All AccessUnlock All Access

Our latest template collection

Ready-to-launch sites for real estate agents, service businesses, and local brands — built to rank, load fast, and convert.

Explore All TemplatesExplore All Templates

Fanfare - Festival & Event Website Template

Fanfare is a colourful festival and event website template: poster hero, flip-card lineup, programme with saved sessions, passes, venue. Next.js, Astro, Sanity.

Download Template
Fanfare - Festival & Event Website Template

Plenar - Conference & Event Website Template

Plenar is a premium conference and event website template: countdown hero, speakers, schedule with saved sessions, tickets, venue map. Next.js, Astro, Sanity.

Download Template
Plenar - Conference & Event Website Template

Vardane - Luxury Expedition & Mountaineering Website Template

Vardane is a premium website template for mountaineering and expedition companies: film hero, route map, itineraries, departures. Next.js, Astro, Sanity.

Download Template
Vardane - Luxury Expedition & Mountaineering Website Template
ComponentsAccordion

Accordion FAQs

View code
Full screen

An FAQ accordion that opens one answer at a time with a smooth CSS grid height animation. React and Tailwind CSS, no dependencies.

AccordionFAQs.tsx
"use client";

// FAQ accordion: one answer open at a time, smooth height animation via CSS grid rows.
// Pure Tailwind + React, no dependencies. Works with Tailwind v3 and v4.

import { useState } from "react";

type Faq = { question: string; answer: string };

type Props = {
  heading?: string;
  faqs?: Faq[];
};

const DEFAULT_FAQS: Faq[] = [
  { question: "How do I search for properties on your website?", answer: "Use the search bar to filter by location, price range, property type and more, then browse the listings that match. Save a search to get new matches by email." },
  { question: "Are the listings updated regularly?", answer: "Yes. Listings sync with our agents' systems throughout the day, so what you see is what's available." },
  { question: "Can I book viewings directly through the website?", answer: "Absolutely. Every listing has a 'Book a viewing' button that shows the agent's available times." },
  { question: "Do you help with financing and mortgages?", answer: "We work with trusted lenders and can introduce you to a mortgage adviser who will walk you through your options." },
  { question: "What types of properties do you specialise in?", answer: "Family homes, apartments and new builds across the city and surrounding suburbs, for both sale and rent." },
];

export default function AccordionFaqs({ heading = "Frequently asked questions", faqs = DEFAULT_FAQS }: Props) {
  const [openIndex, setOpenIndex] = useState<number | null>(0);

  return (
    <section className="bg-white px-5 py-20 font-['Manrope',ui-sans-serif,system-ui,sans-serif] antialiased md:px-10">
      <div className="mx-auto max-w-5xl">
        <h2 className="mb-10 text-center font-['Bricolage_Grotesque',ui-sans-serif,system-ui,sans-serif] text-[clamp(32px,4vw,50px)] font-semibold leading-[1.2] text-black">{heading}</h2>

        <div className="divide-y divide-neutral-200 border-y border-neutral-200">
          {faqs.map((item, index) => {
            const open = openIndex === index;
            return (
              <div key={item.question} className="py-1 md:py-4">
                <button
                  type="button"
                  onClick={() => setOpenIndex(open ? null : index)}
                  aria-expanded={open}
                  className="flex w-full items-center justify-between gap-6 py-4 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-black/40"
                >
                  <span className="text-xl font-medium text-neutral-900 md:text-2xl">{item.question}</span>
                  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.75} aria-hidden className={`h-7 w-7 shrink-0 text-neutral-500 transition-transform duration-300 ${open ? "" : "rotate-180"}`}>
                    <circle cx="12" cy="12" r="10" />
                    <path d="m8 14 4-4 4 4" />
                  </svg>
                </button>
                <div className={`grid transition-all duration-300 ease-in-out ${open ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`}>
                  <div className="overflow-hidden">
                    <p className="pb-4 text-base leading-relaxed text-neutral-600 md:text-lg">{item.answer}</p>
                  </div>
                </div>
              </div>
            );
          })}
        </div>
      </div>
    </section>
  );
}

How to use it

  1. Make sure your Next.js or React project has Tailwind CSS set up (v3 or v4 both work).
  2. Create components/AccordionFAQs.tsx and paste the code.
  3. Import it into a page and replace the sample text and images with your own.
Clay - Modern Real Estate Next.js Template

From the full template

ClayFree

Every page, Sanity CMS and SEO already set up. This section is one of 6 you can try free.

Get the full template Get the full template Live preview Live preview
Share
Category
Accordions
Template
Clay
Dependencies
None, just React
Works with
Next.js, React, Tailwind CSS v3 & v4
Added
Apr 15, 2026

More from Clay

See the full template
Property Listing Cards
Feature

Property Listing Cards

Infinite Image Carousel
Carousel

Infinite Image Carousel

Testimonial Slider
Testimonial

Testimonial Slider

Features Classic
Feature

Features Classic

Features Creative
Feature

Features Creative

More accordions

View all
Careers Accordion
Accordion

Careers Accordion

Sticky FAQ Accordion
FAQ

Sticky FAQ Accordion

Agency Split Hero
Hero

Agency Split Hero

Ready for a faster site that's easier to edit?

Book a free 30-minute call. We'll review your current site and send a fixed-price plan. No pressure, no pitch.

Book Free Call Book Free Call No commitment required

Fast Next.js + Sanity websites, built for you or ready to launch with our templates.

Book a Free Call Book a Free Call
Services
  • Web Design
  • UI/UX Design
  • Framer Dev
  • Webflow Dev
  • Custom Dev
  • Sanity CMS
Resources
  • Templates
  • Pricing
  • License
  • Components
  • Blog
  • Case Studies
Company
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy
© 2026 rayso.studio — All rights reservedDesigned & built in-house Remote-first agency
Let's TalkLet's Talk