Measured entry

ruixen-faq-scroll-accordion

faqunclassifiedmotion on file

A shadcn registry client component for an FAQ that opens entries as they reach the center of its own scroll area. It uses React state, a container-scoped IntersectionObserver, Tailwind theme classes, CSS transitions, an inline SVG chevron, and the shadcn cn utility. It declares no package dependencies.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of ruixen-faq-scroll-accordion at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of ruixen-faq-scroll-accordion at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of ruixen-faq-scroll-accordion at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for ruixen-faq-scroll-accordion
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious1
Axe moderate0
Axe minor0
Gzip marginal27.9 KB (93.3 KB build, 65.4 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 28.86s
error during build:
[vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/faq-scroll-accordion.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'

Verdict

A distinctive fit for short, curated FAQs where the internal scroll behavior is intentional. It mounts cleanly in the prepared harness, but the muted text needs contrast work. A bare project cannot mount it as shipped because it needs a shadcn-style setup, especially the aliased cn utility and theme classes.

Use it if

  • You want a compact FAQ whose active answer follows scrolling inside the component.
  • Your React app already has Tailwind theme tokens and a shadcn-compatible cn helper.
  • You want animation implemented with browser APIs and CSS rather than an animation package.

Skip it if

  • Your design cannot tolerate an internally scrolling FAQ with a hidden scrollbar.
  • You need the shipped colors to pass contrast checks without adjustment.
  • You require complete accordion disclosure attributes such as aria-expanded and aria-controls out of the box.
  • You prefer user-controlled expansion without scroll position automatically changing the open answer.

Install

Installation record for ruixen-faq-scroll-accordion
Declared dependenciesnone declared
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, add Tailwind with the foreground, muted-foreground, and border theme classes used here, provide a cn class-merging helper, and either configure the at-sign source alias or replace that import with a local path. Keep it as a client component and ensure IntersectionObserver is available in supported browsers.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Alternatives

Other published entries for the faq pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.