FAQ

Accordion with helpful votes

Answers that collect feedback as they close

Live preview
Build an FAQ accordion with Tailwind CSS where each answer asks whether it helped. Use native details/summary elements inside a bordered, divided card: the summary row is a flex line with the question in medium weight and a plus glyph that rotates when open, and the answer body is relaxed grey prose. Under every answer add a feedback row — a muted "Was this helpful?" label, a Yes and a No button as small bordered pills, and a right-aligned tally line reading something like "18 of 21 found this helpful". Give the details elements a shared name-like data attribute and each feedback row a data-votes pair of numbers. Then add JavaScript that keeps only one answer open at a time, and on a vote replaces the two buttons with a quiet "Thanks — this helps us rewrite it" note while incrementing the tally and recomputing the ratio, ignoring further clicks in that row.