No-JS FAQ Accordion
Exclusive accordion behaviour from named <details> elements — no state, no hooks, no JavaScript, full keyboard support for free.
The security questions a buyer's IT reviewer asks, answered with scope and dates rather than with the word "enterprise-grade".
components/security-faq-list.tsxnpx hoverlab add security-faq-list
Or over MCP, from your editor's agent — no account needed.
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Start a page with this section — add more, order them, and leave with the page source.
These four arrive in every procurement review. Answering them on a public page rather than in a questionnaire is worth about two weeks of a sales cycle.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <SecurityFaqList> — The security questions a buyer's IT reviewer asks, answered with scope and dates rather than with the word "enterprise-grade".
*
* These four questions arrive in every procurement review, and answering
* them on a public page rather than in a returned questionnaire is worth
* about two weeks of a sales cycle. The layout problem is that security
* copy defaults to adjectives, and the obvious wrong answer is a paragraph
* containing the phrase "enterprise-grade".
*
* Every answer here is a scope, a date or a mechanism. "The region you pick
* at signup, pinned, never replicated out" is checkable. "Bank-level
* security" is not, and a reviewer has read it four hundred times.
*
* The training answer says there is no setting that turns it on. That
* sentence is doing the work: "we don't train on your data" is a policy and
* policies change, while "there is no such setting" is a statement about
* the system. Only make it if it is true.
*
* The internal-access row concedes that support can read data on an
* approved ticket. A security FAQ where nobody can ever see anything is
* read as marketing, because someone has to be able to help you; the
* credible version bounds it and makes the log exportable.
*
* Rows are buttons with `aria-pressed` rather than `<details>` elements —
* this is a selection panel showing one answer at a time, not independent
* disclosures. Take the FAQ accordion if you want rows that open
* separately. `status` is separate from `tone` so "no" and "30 days" read
* without colour. The demo selects the first row.
*/
import * as React from 'react'
type Tone = 'neutral' | 'positive' | 'warning' | 'critical'
export interface SecurityFaqListRow {
id: string
label: string
detail?: string
tone?: Tone
/** What the badge says. Falls back to the tone name when absent. */
status?: string
}
export interface SecurityFaqListProps {
heading?: string
intro?: string
rows?: SecurityFaqListRow[]
className?: string
}
/*
Tones as complete utility classes, never assembled from fragments.
Tailwind scans source text, so `text-${tone}-foreground` produces no
class at all — the same failure as an undefined token, and just as
invisible in review.
*/
const TONE_CLASS: Record<Tone, string> = {
neutral: 'bg-muted text-muted-foreground',
positive: 'bg-primary/10 text-primary',
warning: 'bg-accent text-accent-foreground',
critical: 'bg-destructive/10 text-destructive',
}
const ROWS: SecurityFaqListRow[] = [
{ id: "row-1", label: "Where is our data stored?", detail: "The region you pick at signup. It is pinned there and never replicated out of it.", tone: "positive", status: "pinned" },
{ id: "row-2", label: "Do you train models on it?", detail: "No, and there is no setting that turns it on.", tone: "positive", status: "no" },
{ id: "row-3", label: "Who internally can read it?", detail: "Support, on an approved ticket, time-boxed and logged. You can export that log.", tone: "neutral", status: "logged" },
{ id: "row-4", label: "What happens when we leave?", detail: "Full export any time. Deletion within 30 days of the request, backups included.", tone: "positive", status: "30 days" },
]
export function SecurityFaqList({
heading = "Security, answered properly",
intro = "These four arrive in every procurement review. Answering them on a public page rather than in a questionnaire is worth about two weeks of a sales cycle.",
rows = ROWS,
className,
}: SecurityFaqListProps) {
// Per-instance ids. A literal id in a reusable component is a
// collision waiting for the second copy on the page — and a <label>
// then resolves to whichever input rendered first.
const uid = React.useId()
const [selected, setSelected] = React.useState<string | null>(rows[0]?.id ?? null)
return (
<section
aria-labelledby={`${uid}-security-faq-list-heading`}
className={`w-full bg-background px-6 py-16 ${className ?? ''}`}
>
<div className="mx-auto max-w-3xl">
<h2
id={`${uid}-security-faq-list-heading`}
className="text-2xl font-semibold tracking-tight text-foreground"
>
{heading}
</h2>
<p className="mt-2 text-sm text-muted-foreground">{intro}</p>
<ul className="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
{rows.map((row) => {
const isSelected = row.id === selected
return (
<li key={row.id}>
{/*
A button, not a div with onClick. The row is operable, so
it has to be reachable by keyboard and announce its
selected state — aria-pressed is what carries that.
*/}
<button
type="button"
aria-pressed={isSelected}
onClick={() => setSelected(row.id)}
className={`flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ${
isSelected ? 'bg-muted/40' : ''
}`}
>
<span className="min-w-0 flex-1">
<span className="block truncate text-sm font-medium text-foreground">
{row.label}
</span>
{row.detail ? (
<span className="mt-0.5 block text-sm text-muted-foreground">
{row.detail}
</span>
) : null}
</span>
<span
className={`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium ${
TONE_CLASS[row.tone ?? 'neutral']
}`}
>
{row.status ?? row.tone ?? 'neutral'}
</span>
</button>
</li>
)
})}
</ul>
</div>
</section>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/security-faq-list.tsx and import it where you need the section:
import { SecurityFaqList } from '@/components/security-faq-list'1 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.
Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.
| Prop | Type | Default |
|---|---|---|
heading | string | "Security, answered properly" |
intro | string | — |
rows | SecurityFaqListRow[] | ROWS |
className | string | — |
The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.
This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.
<!--
Security FAQ — markup from the Hoverlab catalog.
This is the block rendered once to HTML and wrapped as a component
file. It is not a port of the React source: the Tailwind classes carry
the design, which is the part that took the work, and they are the same
in every framework.
This block is interactive in React and the handlers are NOT here.
Buttons, toggles and menus render in their initial state and do
nothing until you wire them up.
-->
<section aria-labelledby="_R_0_-security-faq-list-heading" class="w-full bg-background px-6 py-16 ">
<div class="mx-auto max-w-3xl">
<h2 id="_R_0_-security-faq-list-heading" class="text-2xl font-semibold tracking-tight text-foreground">Security, answered properly</h2>
<p class="mt-2 text-sm text-muted-foreground">These four arrive in every procurement review. Answering them on a public page rather than in a questionnaire is worth about two weeks of a sales cycle.</p>
<ul class="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
<li>
<button type="button" aria-pressed="true" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset bg-muted/40">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">Where is our data stored?</span>
<span class="mt-0.5 block text-sm text-muted-foreground">The region you pick at signup. It is pinned there and never replicated out of it.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">pinned</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">Do you train models on it?</span>
<span class="mt-0.5 block text-sm text-muted-foreground">No, and there is no setting that turns it on.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">no</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">Who internally can read it?</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Support, on an approved ticket, time-boxed and logged. You can export that log.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-muted text-muted-foreground">logged</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0 flex-1">
<span class="block truncate text-sm font-medium text-foreground">What happens when we leave?</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Full export any time. Deletion within 30 days of the request, backups included.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">30 days</span>
</button>
</li>
</ul>
</div>
</section>
What each framework gets across the whole catalog — effects convert properly; this rung is markup.
The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.
Want the whole screen instead of this one section? Open a page and copy it entire.
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse FAQCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
Exclusive accordion behaviour from named <details> elements — no state, no hooks, no JavaScript, full keyboard support for free.
Questions on the right against a sticky rail that keeps a route to a human in view — for the visitor whose objection is not on the list.
Every answer rendered and visible in a two-column description list — the FAQ shape for a marketing page, where collapsed text is text a search engine will not quote.
Anchor-linked topic pills over per-topic details groups with the first answer open — for the FAQ that outgrew a single list, working with JavaScript disabled.
A search that narrows the list across answers and keywords, announces the count, and turns an empty result into the contact route it should always have been.
An FAQ written from the objections that stop a sale rather than from the questions that are comfortable to answer.