shadcn.io is not affiliated with official shadcn/ui
Reading Progress FAQ Block for React
A FAQ for a safety-training platform with a reading tracker: a ring that fills as questions are opened, a check on each row you've read, and a Shine Button once all eight are read.
Installation
Overview
A reading-tracker FAQ for React with Base UI. A start-aligned header sits over a progress band under a rule with + marks: a ring that fills as you open questions, with "1 of 8 read" beside it. Below it, eight questions run from rail to rail; a row you've opened gets a small check at its start, and several can stay open. At 8 of 8 the band reads "You're all caught up" and the block's one Shine Button, "Start the safety check", appears at its end. Progress lives in memory, so nothing is stored. It's built from Accordion, Circular Progress, Shine Button and Guides, with CSS transitions for the ring and the entrance and your theme's tokens for every colour. For onboarding, policy and training pages where finishing the reading is part of the goal.
FAQ
How do I change the questions and the final action?
Edit QUESTIONS at the top of the file: each entry is an id, the question and its answer. The header and the band's words say "Eight", so change them if you add or remove a question: the count and the ring's percentage come from the list's length. The final Shine Button is a link (href="#"): point it at your quiz or sign-off page.
The button renders the link it's given with render, with nativeButton={false}.
What counts as read?
A question counts the first time it opens, including the one that is open when the page loads, and closing it doesn't undo it. The ring, the "of 8" count and the checks all come from one list of ids in state; a reload starts again from OPEN_QUESTION. To keep progress, write that list to storage or your own endpoint and read it back in an effect after mount.
The Accordion takes multiple, so any number of rows stay open.
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, and it begins with "Read:" for screen readers once you've opened it. The ring is decorative; the words beside it are a polite status that reads "3 of 8 read" and, at the end, "You're all caught up". When the Shine Button appears it takes its place after the band in the reading order.
Tab moves between the questions; the arrow keys don't move between questions on this base.
Are the closed answers in the page's markup?
Yes. The Accordion takes hiddenUntilFound, so every closed answer stays in the markup as hidden="until-found": search engines see all eight, and the browser's find in page opens the answer that holds a match.
What moves, and what happens with reduced motion?
The header and the band fade up once when the page loads, and the ring's stroke eases to its new length each time you open a question. With reduced motion the entrance is off and the ring jumps to the new length. The answers open and close at once, with no height animation.
Related
- Pro
Checklist FAQ
Steps and plansA FAQ you tick off for a booking tool: a progress panel beside seven setup tasks, each a real checkbox with its answer, behind a split divider.
- Pro
Onboarding FAQ
Steps and plansA first-hour plan as an FAQ for a team workspace: five accordion steps down a numbered rail, each with its duration, under a header that adds the minutes up.
- 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
Wizard FAQ
Steps and plansA FAQ that shows one question at a time for an analytics tool: a numbered step list, the active question and answer, and Previous and Next buttons in a card in card.
- 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
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.