shadcn.io is not affiliated with official shadcn/ui
Double Line Timeline Block for React
Seven project milestones on two rails, plan and actual, joined by a tie that carries the slip as plus, minus or zero days, with an Original or Re-plan 1 baseline switch that recomputes every tie.
Installation
Overview
Put what was planned next to what happened with this double-line timeline for React with Base UI. It is written for Twinrail, a fictional project-baseline tool. A hairline frame with a plus mark on each corner holds seven milestones of a clinic-portal rollout in three columns: the plan on one rail, the actual date on the other (a forecast is dashed) and between them a short tie for each milestone that carries the slip with a sign and a word, "+7 d late", "0 d on plan", "-2 d early". A segmented control, Baseline: Original or Re-plan 1, swaps the planned rail and recomputes every tie and the three figures above the rails: the slip at handover, how many milestones are late and the biggest slip. On a phone the two rails become one: each milestone shows its planned and actual date under its name, with the slip at the end of the line. It is built from SegmentGroup, Badge and Guides with CSS for the rails. For project plans, migrations, releases and any schedule that has been re-planned. The dates are example data.
FAQ
How do I change the milestones and the baselines?
Edit MILESTONES at the top of the file. Each has a name, the actual date (or the forecast), a done flag and one planned date per baseline (original and replan). Add a baseline by adding an entry to BASELINES and a field to each milestone, then read it in plannedOf(). The slip is the actual date minus the planned date in whole days.
How is a forecast shown?
A milestone that is not done has a dashed dot, a dashed segment arriving at it, a dashed tie and the word "Forecast" instead of "Actual". The key under the rails says so.
How is the slip written?
As a signed number of days, never as a colour: plus for late, minus for early and zero for on plan, with a hidden word that a screen reader speaks after the number. Up and down are not green and red.
What stays in the page?
The chosen baseline. Nothing is saved or sent. To make it real, load the baselines from your planning tool and pass the milestones of one project in; the ties and figures follow.