shadcn.io is not affiliated with official shadcn/ui
Pill Segments Stepper Block for Solid
A yoga class builder whose four blocks are the pills of a segmented control, with a thumb that slides under the current one and a class length worked out from the blocks you keep.
Installation
Overview
Make the stepper a segmented control, with this pill stepper for Solid with Ark UI. A plus-marked frame holds a muted pill track of four Steps buttons: Warm-up, Flow, Balance and Cool-down. A card-coloured thumb slides under the one you are on, and a small dot marks the blocks you have reached. Each block lists its three poses with their minutes in a Data List and has a Switch to leave the block out; the line above says "Class length 48 min" and follows the switches. "Next block" is the block's one Shine Button, and the last press saves the class. On a phone the track scrolls sideways. For builders, pickers and any flow with a few short parts.
FAQ
How do I change the blocks?
BLOCKS lists each block with its id, a title, a sentence and its poses as a name and minutes. The block's total, the class length and the saved summary are worked out from them and from the list of blocks switched off. The thumb's width is a quarter of the track: change the 4 in the two calc() values if you add or remove a block.
What stays local, and how do I make it real?
The class is component state, and saving ends on a note that says it was not added to a timetable. To make it real, send the ids of the blocks that are in from advance on the last step to your API.
How does the thumb work?
It is a drawing under the buttons, placed with a CSS variable for the step's index and moved with a transition on its inline start, so it follows the track in a right-to-left layout. The transition is skipped when reduced motion is on. The real state is on the buttons.
How does the keyboard work?
The track is one tab stop on the current pill. Arrow keys move between the pills you can reach, Home and End jump to the ends, and Enter or Space opens the focused one; in a right-to-left layout the arrows swap. Pills past the furthest block reached are disabled.