Skip to content

No.365 · Feedback· New

Segmented Progress

The track is split into equal steps: whole segments fill solid and the current one fills partly, so progress reads as 'step 3 of 5'. Good for onboarding, password strength and courses.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Light

Build a segmented progress indicator with a label and a value (0–100). Inter 500 at 14px. Above the bar: the label on the left and the value on the right in muted tabular figures (the rounded percentage, or a detail such as '7.2 GB of 10 GB'). Bars come in three sizes (4, 8 and 12px tall) with fully rounded tracks; value changes ease over 0.45s. The track is split into equal segments with 4px gaps and 3px corners; whole segments fill solid and the current one fills partly from its left (a scaleX per segment). At 100 every segment turns green. Semantics: role=progressbar on the track, labelled by the label, with aria-valuemin/max/now and aria-valuetext set to the detail when there is one. Palette (light / dark): ink and fill #18181b / #ececef, muted #6b6b73 / #a1a1aa, track #ececef / #232327. At 100 the fill turns green (#15803d / #3fb950). Show three examples on a white / #0b0b0c page. Examples: 'Setting up your workspace' in 5 steps reading 'Step n of 5'; 'Password strength' in 4 at 75% reading 'Strong' (small); a 12-part course bar (large). Selected variant — Light (light): Palette for this theme (Light): --sgpb-done #15803d; --sgpb-fill #18181b; --sgpb-ink #18181b; --sgpb-soft #6b6b73; --sgpb-track #ececef. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "light". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: None; it reports progress. Motion: Each segment's fill eases over 0.4s. Reduced motion jumps straight to the value. Accessibility: role=progressbar with a label, min, max, now and a human value text such as 'Step 3 of 5'. Responsive behavior: The segments share the container width equally. Touch: Nothing to tap. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
None; it reports progress.
Motion
Each segment's fill eases over 0.4s. Reduced motion jumps straight to the value.
Accessibility
role=progressbar with a label, min, max, now and a human value text such as 'Step 3 of 5'.
Responsive
The segments share the container width equally.
On touch
Nothing to tap.

Featured

425 components