Release Rail.
A pipeline view for builds and deploys. Each stage shows its status, duration, and details, including failed checks.
Add className="my-release-rail" to your component.
Make a change to create your CSS.
Deployed.
Version 1.0.3 is live in production.
Upload completeEdge cache warmedProduction alias assigneddark mode.Read the changelog ↗
4 of 4 stages complete.
Installation
In a project with React and shadcn configured, run:
npx shadcn@latest add https://aduneer.github.io/opalframe/r/release-rail.jsonCopies the component and its stylesheet into components/ui. No additional runtime dependencies. Tailwind classes work through className.
For manual installation, copy both files from Source below. Keep the CSS import alongside the component.
Usage
import { ReleaseRail } from "@/components/ui/release-rail";
export default function Example() {
return (
<ReleaseRail steps={[
{
id: "build", label: "Build", status: "complete",
duration: "12s", detail: <p>Build successful.</p>,
},
{
id: "deploy", label: "Deploy", status: "running",
detail: <p>Uploading assets...</p>,
},
]} />
);
}Customize
Colors and sizes are scoped CSS variables. Override them on your own class.
<ReleaseRail steps={liveDeploymentSteps} className="my-release" />
.my-release {
--rail-accent: #a6cfff;
--rail-surface: #1e2029;
--rail-text: #f2f3f8;
--rail-muted: #aeb4c4;
--rail-border: #3d4354;
}Props
| Prop | Type | What it does |
|---|---|---|
steps | ReleaseStep[] | Stages with pending, running, complete, or error status. |
value / defaultValue | string | Controlled or initial inspected stage ID. |
onValueChange | (id: string) => void | Called when a stage is inspected. |
label | string | Accessible label for the stage list. |
reducedMotion | boolean | Disable visual transitions. |
className | string | Root customization. |
Accessibility & motion
Details reserve space for the largest panel, so inspecting stages does not shift the page. Inactive panels are hidden and inert. Every stage is a native button with a pressed state. Status uses text as well as color; progress announces through a status region. No timers or automatic animation run inside the component.
Dependencies
React only. Styles live in a plain CSS file next to the component, and Tailwind utilities work through className.
Source
release-rail.tsx
"use client";
import { useId, useState, type ReactNode } from "react";
import "./release-rail.css";
export interface ReleaseStep {
id: string;
label: string;
status: "pending" | "running" | "complete" | "error";
duration?: string;
detail: ReactNode;
}
export interface ReleaseRailProps {
steps: ReleaseStep[];
value?: string;
defaultValue?: string;
onValueChange?: (value: string) => void;
className?: string;
label?: string;
reducedMotion?: boolean;
}
export function ReleaseRail({
steps,
value,
defaultValue,
onValueChange,
className = "",
label = "Deployment stages",
reducedMotion = false,
}: ReleaseRailProps) {
const uid = useId();
const [internalValue, setInternalValue] = useState(
defaultValue ?? steps[0]?.id,
);
const selected =
steps.find((step) => step.id === (value ?? internalValue)) ?? steps[0];
if (!selected) return null;
return (
<div
className={`is-rail ${className}`}
data-reduced-motion={reducedMotion || undefined}
>
<ol className="is-rail-steps" aria-label={label}>
{steps.map((step, index) => (
<li key={step.id} data-status={step.status}>
<button
type="button"
aria-pressed={selected.id === step.id}
aria-controls={`${uid}-detail-${step.id}`}
onClick={() => {
if (value === undefined) setInternalValue(step.id);
onValueChange?.(step.id);
}}
>
<span className="is-rail-node" aria-hidden="true">
{step.status === "complete"
? "✓"
: step.status === "error"
? "!"
: String(index + 1).padStart(2, "0")}
</span>
<span className="is-rail-label">{step.label}</span>
<span className="is-rail-duration">
{step.duration ??
(step.status === "pending"
? "Queued"
: step.status === "running"
? "In progress"
: step.status === "error"
? "Failed"
: "Done")}
</span>
<span className="is-rail-sr">{step.status}</span>
</button>
</li>
))}
</ol>
<div className="is-rail-detail">
{steps.map((step) => (
<div
key={step.id}
className="is-rail-panel"
id={`${uid}-detail-${step.id}`}
role="region"
aria-label={`${step.label} details`}
data-active={step.id === selected.id}
aria-hidden={step.id !== selected.id}
inert={step.id !== selected.id}
>
{step.detail}
</div>
))}
</div>
<p className="is-rail-sr" role="status">
{steps.filter((step) => step.status === "complete").length} of{" "}
{steps.length} stages complete.{" "}
{steps
.filter(
(step) => step.status === "running" || step.status === "error",
)
.map(
(step) =>
`${step.label} ${step.status === "error" ? "failed" : "in progress"}.`,
)
.join(" ")}
</p>
</div>
);
}
release-rail.css
.is-rail {
--rail-accent: var(--accent, #aacfff);
--rail-border: var(--line, #343439);
--rail-text: var(--text, #f1f1f3);
--rail-muted: var(--muted, #a1a1aa);
width: 100%;
min-width: 0;
color: var(--rail-text);
}
.is-rail-steps {
padding: 0;
margin: 0;
list-style: none;
display: flex;
gap: 0;
}
.is-rail-steps li {
flex: 1;
min-width: 0;
position: relative;
}
.is-rail-steps li:not(:last-child)::after {
content: "";
position: absolute;
top: 20px;
left: calc(50% + 25px);
width: calc(100% - 50px);
height: 1px;
background: var(--rail-border);
}
.is-rail-steps li[data-status="complete"]::after {
background: var(--rail-accent);
opacity: 0.5;
}
.is-rail-steps button {
position: relative;
display: flex;
width: 100%;
flex-direction: column;
gap: 9px;
align-items: center;
border: 0;
background: none;
font: inherit;
color: var(--rail-muted);
padding: 0 0 18px;
cursor: pointer;
}
.is-rail-node {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border: 1px solid var(--rail-border);
border-radius: 50%;
font:
11px ui-monospace,
monospace;
background: var(--rail-surface, #19191c);
transition:
background 200ms,
color 200ms,
box-shadow 200ms;
}
.is-rail-steps [data-status="complete"] .is-rail-node {
background: var(--rail-accent);
border-color: var(--rail-accent);
color: var(--rail-ink, #141418);
}
.is-rail-steps [data-status="running"] .is-rail-node {
color: var(--rail-accent);
border-color: var(--rail-accent);
}
.is-rail-steps [data-status="error"] .is-rail-node {
color: var(--rail-error, #f29191);
border-color: var(--rail-error, #f29191);
}
.is-rail-steps button[aria-pressed="true"] .is-rail-node {
box-shadow: 0 0 0 5px color-mix(in srgb, var(--rail-accent) 12%, transparent);
}
.is-rail-steps button[aria-pressed="true"] .is-rail-label {
color: var(--rail-text);
}
.is-rail-label {
font-size: 12px;
font-weight: 550;
}
.is-rail-duration {
font:
10px ui-monospace,
monospace;
}
.is-rail-detail {
display: grid;
margin-top: 16px;
padding-top: 22px;
border-top: 1px solid var(--rail-border);
min-height: 138px;
}
.is-rail-panel {
grid-area: 1 / 1;
min-width: 0;
visibility: hidden;
}
.is-rail-panel[data-active="true"] {
visibility: visible;
}
.is-rail-steps button:focus-visible {
outline: 2px solid var(--rail-accent);
outline-offset: 3px;
border-radius: 6px;
}
.is-rail-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.is-rail[data-reduced-motion] * {
transition: none !important;
}
@media (max-width: 420px) {
.is-rail-node {
width: 32px;
height: 32px;
}
.is-rail-steps li:not(:last-child)::after {
top: 16px;
left: calc(50% + 21px);
width: calc(100% - 42px);
}
.is-rail-label {
font-size: 10px;
}
.is-rail-duration {
font-size: 9px;
}
}
@media (prefers-reduced-motion: reduce) {
.is-rail * {
transition: none !important;
}
}