shadcn.io is not affiliated with official shadcn/ui
Accordion Step By Step Blog Block for React
A tutorial in five steps: a single-open accordion on a vertical rail, a Done button that ticks a step and opens the next, and a framed drawing of the open step.
Installation
Overview
A tutorial block for React with Base UI, written for Fretsaw Weekly, a woodworking blog: how to cut a through mortise and tenon by hand. A start-aligned header says how many steps are done and about how long the rest takes. Below it, a split behind a divider: at the start a single-open accordion of five steps hung on a vertical rail, each with a marker (a number, a tick once done, a haloed ring for the one you are on), its title and its time; the open step shows its text, what you need and the block's Shine Button, "Done, next step", which ticks the step, opens the next and moves focus to it. At the end a framed drawing of the open step. On a phone the drawing sits under the step's text. It's built from Accordion, ShineButton, Button and Guides. What you tick stays in this page.
FAQ
How do I change the steps?
Edit STEPS: each has an id, a title, the minutes it takes, its text and what you need. The header's "2 of 5 steps done, about 40 minutes to go", the markers and the "Step 3 of 5" caption derive from it. START_DONE and START_OPEN set what is ticked and open on first show. The drawing is chosen by the step's id, so a new step needs a drawing with the same id.
What do the buttons do?
"Done, next step" marks the step done, opens the next one and moves focus to its heading, because the button leaves with the panel it was in. On a step you have already done the button reads "Mark as not done" and takes the tick back. A polite status says what happened ("Step 3 done. Step 4, Pare to a snug fit, is open.").
How does the accordion work from the keyboard?
Enter and Space open a step, and one step is always open. This accordion has no arrow-key navigation of its own: Tab moves between the step headings.
Is the text of closed steps in the page?
Yes. The Accordion takes hiddenUntilFound, so every closed step stays in the markup as hidden="until-found".
Related
- Pro
Tick-Off Checklist Blog
Tutorials and seriesA "before you start" checklist for a tutorial: six real checkboxes for tools and parts, struck through when ticked, with a count, a thin bar and a Reset.
- 3Pro
Series Tracker Blog
Tutorials and seriesA reader's place in a six-part series: the catalog's vertical Steps with a tick for each part read, the current part's panel with a typographic cover, a thin progress bar and a Shine Button that continues to the next part.
- 765Pro
Countdown Toggle Listicle Blog
Post listsA seven-item countdown with huge drawn numerals, prep-time and difficulty chips, and a Countdown / Count up toggle that reverses the list without moving the page.
- Pro
Sequential Milestone Checklist Features
Timelines and stepsA features section for a launch-readiness tool: five milestones in an accordion, each a grouped checklist of real checkboxes, with every milestone locked until the one before it is complete.
- Pro
Numbered Rail Thread Blog
Story formatsA numbered thread: six parts hung on a vertical rail with their "1/6" chips, the author once at the top, the first four in view and a Show 2 more button that opens the last two.
- Pro
Rail Timeline Blog
Archives by dateA local-history society's notebook as a vertical rail: a band per year, the year sticky at the rail's start, and dated entries hung off the rail on dots.