shadcn.io is not affiliated with official shadcn/ui
Reactions FAQ Block for React
A start-aligned FAQ for a design-feedback tool: six rows whose open answers end in four reaction chips, each a face or a heart with a word and a count, plus running totals.
Installation
Overview
A reaction FAQ for React with Base UI. A start-aligned header with a running total of reactions sits over six questions that run from rail to rail under a rule with + marks, and every row shows how many reactions it has. Each open answer ends in four chips (Clear, Love it, Cheers, Still thinking), each a small face or heart from lucide with a word and a count. Pressing a chip adds you to its count, pressing it again takes you out, and a pressed chip turns to the text colour on the page colour (never the primary). A polite line says what you reacted with, and nothing leaves the page. It's built from Accordion, Toggle, Badge and Guides, with CSS transitions for the entrance and your theme's tokens for every colour. For design tools, changelogs and docs where a quick reaction is easier than a form.
FAQ
How do I change the questions and the reactions?
Edit QUESTIONS at the top of the file: each entry is an id, the question, its answer and counts, how many people reacted before you, in the order of REACTIONS. REACTIONS holds each chip's lucide icon, id and word. OPEN_QUESTION names the row that's open on load. One answer is open at a time.
Add multiple to the Accordion to let several stay open.
Why icons instead of emoji?
Emoji glyphs are drawn by the visitor's system in colour, which breaks the block's greyscale and looks different on every platform. A lucide face draws in the text colour, turns to the page colour when pressed and sits well in every theme, so each chip is an icon, a word and a count. The faces are lucide's own (a smile, a heart, a party popper and a neutral face for "Still thinking"); swap the icon of an entry in REACTIONS for any other lucide icon.
What happens when I press a chip?
You're added to that chip's count, and the row's total and the total in the header go up by one. Press it again and you're taken out. Several chips can be on at once, and a polite line lists them ("You reacted: Clear, Love it."). Your reactions live in the component's state, so a reload clears them; to store them, call your own endpoint from the toggle function.
How does it work with a keyboard and a screen reader?
Each question is a button inside its own h3 under the section's h2. The chips are toggle buttons in a group named after the question; each is read with its word and its count ("Love it 18") and says whether it's pressed. The counts sit in bdi, so a right-to-left layout keeps the digits in order.
Tab moves between the questions and the chips in each open answer; the arrow keys don't move between questions on this base.
Related
- Pro
Feedback FAQ
Votes and reactionsA centred FAQ for a scheduling app: seven accordion rows whose open answers end in a Was this helpful? foot with Yes and No, reason chips after a No, and a polite thank-you.
- Pro
Rating FAQ
Votes and reactionsA reverse-split FAQ for a recipe app: seven rows that each show an average rating, with a one-to-five scale at the foot of every open answer and the header beside the rows.
- Pro
Votes FAQ
Votes and reactionsA community FAQ for a product forum: six accordion rows with a vote rail at the start of each, an up arrow, a score and a down arrow, one vote per answer that can be taken back.
- Pro
Reaction Pills Testimonials
Chats and postsA launch-week chat in a split: the headline and a Shine Button in a rail, and four messages ruled apart by hairlines, each with celebrate, love and ship-it reaction pills that really toggle and count.
- Pro
Bookmarks FAQ
Reading and sharingA side-header FAQ for a music-lessons platform: a star on every row, a framed Saved questions panel, and an All and Saved filter that shows only the rows you kept.
- Pro
Accordion FAQ
Accordion listsA side-header FAQ for a web analytics tool: the title, one sentence and a contact prompt beside seven questions in an accordion, behind a split divider.