section-017

Searchable FAQ

Included in the VaultGet the Vault

A complete help section with searchable answers, topic filters, native disclosures and a clear route to a real person. Built around a warm editorial workspace example.

intermediate
7 more details
click-togglestate-transitionprogressive-enhancementinterruptible-transitionskeyboard-navigationcontainer-queriesresponsive-section
Searchable FAQ - website section preview

This section reads better at your own screen size than in the frame below:

About this section

Searchable FAQ Section gives visitors two useful ways into a set of answers: search for a specific concern, or narrow the list to a relevant topic. The fictional Parcel shared workspace example covers joining, the working day and membership, with nine concise questions written around practical booking decisions. A separate contact panel makes the route to human help visible alongside the answers.

Read the full section overview

Warm cream, oxblood serif type and a broad ruled question list give the section an editorial identity without introducing decorative media. At desktop width, the introduction and contact sit beside the answer finder. On smaller containers, the search and topic controls sit immediately above the answers, with contact following the list.

Native disclosures keep every answer reachable without scripts. With enhancement, local search includes both questions and answers, topic controls and counts come from the actual markup, and disclosure height transitions respond to repeated or reversed input. The section owns only its own controls and animations, supports live reduced-motion changes and can be mounted independently more than once.

What's included

10 items
  • Nine semantic questions across joining, workday and membership topics
  • Local search across both question and answer copy with combined topic filtering
  • Topic controls and counts derived from the authored details elements
  • Scope-aware polite result announcements, empty state and one-click reset
  • Native details and summary fallback with every answer reachable without JavaScript
  • Interruptible disclosure height transitions that settle on the latest input
  • Distinct support panel with a clearly identified sample email destination
  • Root-scoped brand variables, named container queries and independent instances
  • Instant reduced-motion responses including preference changes while mounted
  • Documented teardown and remount for integration into larger pages

Perfect for

4 use cases
  • Shared workspaces answering pre-booking and membership questions
  • Fitness studios explaining trials, facilities and recurring membership
  • Subscription products grouping onboarding and billing support
  • Venues answering access, arrival and booking questions

How it works

3 sections

Every question and answer is authored once in semantic details markup. The initial HTML works as native disclosures, so all content remains available without JavaScript or when GSAP cannot load. Search tools appear only after the section has initialised successfully.

The enhanced section derives its topic buttons from each question’s data-topic value and searches visible question and answer text locally. Search terms and the selected topic combine, and the result line names that scope. Empty results offer a reset beside the persistent contact route. No backend or duplicated content array is required.

Opening or closing a question animates only its answer height. Repeated input interrupts that transition at its current height and settles at the latest requested state; natural height is restored afterward. Reduced motion switches disclosures instantly. Each root has independent state and a destroy method that restores the native reading experience without touching the host page’s scrolling or animation.

Difficulty Intermediate
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this website section's demo, 15 September 2026. A measurement of the demo as shipped, not a promise for your page.

Accessibility
100
Best practices
100

No performance score, on purpose. That figure depends on how you deploy: your server's compression and caching, your CDN, the connection and the device doing the test, none of which the code controls. The same page can score very differently on two consecutive runs, so measure it where it will live.

Included in the Vault

Get the Vault to use this section.

The Vault includes Searchable FAQ, the HTML, CSS and JavaScript source, the full documentation, an AI setup prompt for your editor, and every update we ship to it. Standard license: unlimited personal and commercial projects. Sections are available only in the Vault for now while the collection is small.

Documentation

Quick start

  1. Keep assets/style.css and assets/script.js together with your page.
  2. Copy the complete <section class="parcel-faq" data-searchable-faq …> from index.html into your page. The surrounding main, preview body style and document metadata are demo context.
  3. Load the CSS, GSAP core and section script in that order:

Code snippet omitted: it ships with the download.

No build step, extra GSAP plugin or scroll library is needed. Every answer remains available through native disclosures if either script fails.

Make it yours

Edit the heading, introduction, each question’s summary, and the paragraph HTML inside [data-faq-answer]. Change the section’s accessible label to your organisation. The h2 suits a section inside an existing page; you can change its tag while retaining its class.

Replace the mailto:hello@parcel.example link with your real support email or help page, and replace the sample contact/policy note. The .example address demonstrates a destination; it does not send to a real support service. There is no form or backend included.

The design intentionally has no content images. Its content is readable answers, so there are no image files, crop dependencies or asset-generation steps.

For a fitness studio, change the introductory copy, use data-topic="Getting started", data-topic="Your visit" and data-topic="Membership", and replace the workspace policies with your actual trial, facilities and billing information.

Add, remove or reorder questions

Each repeated item is a complete details[data-faq-item] with a data-topic label, a summary and a [data-faq-answer] wrapper. Duplicate that markup to add an answer, or remove/reorder it. The script derives topics and counts from these elements in document order; no JavaScript content array needs updating. Leave open on any answer that should initially be visible.

There is no hard-coded item limit. A single topic hides unnecessary category navigation. An empty list keeps a helpful message and contact route. After editing the DOM while mounted, call the instance’s destroy() before editing and then ParcelFAQ.mount(root).

Brand controls

The token block on .parcel-faq owns the ground, text, muted text, accent, rule and control colours; display/body font families; content width; gutter, vertical spacing and column gap; and corner radius. All styling stays within this root. Recheck contrast when changing colours: the supplied accent/ground and muted/ground combinations meet text contrast requirements, but arbitrary replacements may not.

Behaviour and options

data-faq-duration="0.28" controls disclosure duration in seconds, clamped from 0 to 1. Reduced motion always takes precedence. Search matches all space-separated words against both the question and answer, ignoring case and accents; the chosen topic narrows those results. The result count names the active scope. Reset clears both topic and search. Multiple answers can stay open for comparison.

The script automatically mounts every [data-searchable-faq] on DOM readiness. For client-side routing:

Code snippet omitted: it ships with the download.

Each root also exposes its current instance as root.parcelFaq. Destroy restores authored open states, removes generated category controls and IDs, and reveals the unfiltered reading order. Call it before removing a mounted root. No global animation, navigation or scrolling is changed.

Accessibility and integration

Native summary controls support keyboard and touch; open state is exposed to assistive technology. Search has a visible label. Topic buttons expose their pressed state, and a polite status announces result counts. Visible focus, a recovery action for zero results, reduced motion and dependency-free disclosure fallbacks are included.

The layout responds to the section’s container, so it can sit in a narrow host column. It has no sticky or fixed-height requirements. Questions deliberately continue in normal document flow; expanding answers and filtering results change the section’s natural height. The contact panel follows the answers on narrow screens. Preserve the outer root, the structural classes and data-faq-* hooks when redesigning.

Dependencies and credits

  • GSAP core 3.15.0; no plugins used. See GSAP licensing.
  • System Arial/Helvetica and Georgia/Times New Roman stacks; no bundled or remote font assets.
  • No photography, third-party artwork or external content assets. Parcel, its policies and contact details are fictional sample content.
  • Section files are supplied under your GSAP Vault licence.

Worked examples, the events and programmatic API, and the class reference ship with the download, alongside the full source.

Your cart

Your cart is empty

The Vault £99

The Vault library, plus future additions to the library.