<div class="demo-caption">A deploy, in progress</div>
<div class="demo-split">
<ray-timeline id="demo-tl-deploy" active="2" bullet-size="26">
<ray-timeline-item label="Build" time="12:00:05 · 4.1 s" icon="terminal">Compiled 42 modules on runner-3.</ray-timeline-item>
<ray-timeline-item label="Tests" time="12:00:11 · 128 passed" icon="circle-check">Unit, browser and visual tests.</ray-timeline-item>
<ray-timeline-item label="Upload" time="12:00:14" icon="upload" line-variant="dashed">Bundles for macOS, Linux and Windows.</ray-timeline-item>
<ray-timeline-item label="Release" time="waiting" icon="download">Publishes update.json to the stable channel.</ray-timeline-item>
</ray-timeline>
<ray-stack gap="sm">
<span class="demo-muted">active is the last reached item: the bullets fill and the line colors up to it.</span>
<ray-group gap="xs">
<ray-button size="xs" variant="default" id="demo-tl-prev">← Back</ray-button>
<ray-button size="xs" id="demo-tl-next">Advance →</ray-button>
<ray-button size="xs" variant="light" color="red" id="demo-tl-fail">Fail the upload</ray-button>
</ray-group>
</ray-stack>
</div>
<div class="demo-caption">Activity, with avatars</div>
<ray-timeline active="3" bullet-size="28" line-width="2" color="gray" class="demo-tl-activity">
<ray-timeline-item label="Ada merged #482" time="2 min ago"><ray-avatar slot="bullet" name="Ada Lovelace" color="pink" size="sm"></ray-avatar>“Per-page modules” into main.</ray-timeline-item>
<ray-timeline-item label="Alan commented" time="1 h ago"><ray-avatar slot="bullet" name="Alan Turing" color="blue" size="sm"></ray-avatar><blockquote class="demo-tl-quote">The docs load in half the time now.</blockquote></ray-timeline-item>
<ray-timeline-item label="Grace requested a review" time="yesterday"><ray-avatar slot="bullet" name="Grace Hopper" color="teal" size="sm"></ray-avatar>On <ray-badge variant="light" normal-case>#482</ray-badge></ray-timeline-item>
<ray-timeline-item label="Katherine opened #482" time="Oct 6"><ray-avatar slot="bullet" name="Katherine Johnson" color="orange" size="sm"></ray-avatar>12 files changed.</ray-timeline-item>
</ray-timeline>
<div class="demo-caption">Right-aligned, colors, line variants</div>
<div class="demo-grid">
<ray-timeline active="1" align="end" color="violet">
<ray-timeline-item label="Ordered" time="Mon 10:24"></ray-timeline-item>
<ray-timeline-item label="Shipped" time="Tue 08:02"></ray-timeline-item>
<ray-timeline-item label="Out for delivery" time="expected Thu"></ray-timeline-item>
</ray-timeline>
<ray-timeline active="3" bullet-size="14">
<ray-timeline-item label="v1.27.36" time="Sep 12" line-variant="dotted"></ray-timeline-item>
<ray-timeline-item label="v1.27.37" time="Sep 26"></ray-timeline-item>
<ray-timeline-item label="v1.27.38 (security fix)" time="Oct 1" color="red" icon="alert-triangle"></ray-timeline-item>
<ray-timeline-item label="v1.27.39" time="Oct 8"></ray-timeline-item>
</ray-timeline>
</div>
<script type="module">
const tl = document.getElementById("demo-tl-deploy");
const upload = tl.items[2];
document.getElementById("demo-tl-next").addEventListener("click", () => { tl.active = Math.min(tl.active + 1, tl.items.length - 1); });
document.getElementById("demo-tl-prev").addEventListener("click", () => { tl.active = Math.max(tl.active - 1, -1); });
document.getElementById("demo-tl-fail").addEventListener("click", () => {
const failed = upload.color === "red";
upload.color = failed ? undefined : "red";
upload.icon = failed ? "upload" : "circle-x";
upload.time = failed ? "12:00:14" : "12:00:19 · timed out";
});
</script>
import { RayTimeline, RayTimelineItem, RayStack, RayGroup, RayButton, RayAvatar, RayBadge } from "@raylang/react";
export function TimelineExample() {
return (
<>
<div className="demo-caption">A deploy, in progress</div>
<div className="demo-split">
<RayTimeline id="demo-tl-deploy" active={2} bulletSize="26">
<RayTimelineItem label="Build" time="12:00:05 · 4.1 s" icon="terminal">Compiled 42 modules on runner-3.</RayTimelineItem>
<RayTimelineItem label="Tests" time="12:00:11 · 128 passed" icon="circle-check">Unit, browser and visual tests.</RayTimelineItem>
<RayTimelineItem label="Upload" time="12:00:14" icon="upload" lineVariant="dashed">Bundles for macOS, Linux and Windows.</RayTimelineItem>
<RayTimelineItem label="Release" time="waiting" icon="download">Publishes update.json to the stable channel.</RayTimelineItem>
</RayTimeline>
<RayStack gap="sm">
<span className="demo-muted">active is the last reached item: the bullets fill and the line colors up to it.</span>
<RayGroup gap="xs">
<RayButton size="xs" variant="default" id="demo-tl-prev">← Back</RayButton>
<RayButton size="xs" id="demo-tl-next">Advance →</RayButton>
<RayButton size="xs" variant="light" color="red" id="demo-tl-fail">Fail the upload</RayButton>
</RayGroup>
</RayStack>
</div>
<div className="demo-caption">Activity, with avatars</div>
<RayTimeline active={3} bulletSize="28" lineWidth={2} color="gray" className="demo-tl-activity">
<RayTimelineItem label="Ada merged #482" time="2 min ago"><RayAvatar slot="bullet" name="Ada Lovelace" color="pink" size="sm" />“Per-page modules” into main.</RayTimelineItem>
<RayTimelineItem label="Alan commented" time="1 h ago"><RayAvatar slot="bullet" name="Alan Turing" color="blue" size="sm" /><blockquote className="demo-tl-quote">The docs load in half the time now.</blockquote></RayTimelineItem>
<RayTimelineItem label="Grace requested a review" time="yesterday"><RayAvatar slot="bullet" name="Grace Hopper" color="teal" size="sm" />On <RayBadge variant="light" normalCase>#482</RayBadge></RayTimelineItem>
<RayTimelineItem label="Katherine opened #482" time="Oct 6"><RayAvatar slot="bullet" name="Katherine Johnson" color="orange" size="sm" />12 files changed.</RayTimelineItem>
</RayTimeline>
<div className="demo-caption">Right-aligned, colors, line variants</div>
<div className="demo-grid">
<RayTimeline active={1} align="end" color="violet">
<RayTimelineItem label="Ordered" time="Mon 10:24" />
<RayTimelineItem label="Shipped" time="Tue 08:02" />
<RayTimelineItem label="Out for delivery" time="expected Thu" />
</RayTimeline>
<RayTimeline active={3} bulletSize="14">
<RayTimelineItem label="v1.27.36" time="Sep 12" lineVariant="dotted" />
<RayTimelineItem label="v1.27.37" time="Sep 26" />
<RayTimelineItem label="v1.27.38 (security fix)" time="Oct 1" color="red" icon="alert-triangle" />
<RayTimelineItem label="v1.27.39" time="Oct 8" />
</RayTimeline>
</div>
</>
);
}
<template>
<div class="demo-caption">A deploy, in progress</div>
<div class="demo-split">
<RayTimeline id="demo-tl-deploy" :active="2" bullet-size="26">
<RayTimelineItem label="Build" time="12:00:05 · 4.1 s" icon="terminal">Compiled 42 modules on runner-3.</RayTimelineItem>
<RayTimelineItem label="Tests" time="12:00:11 · 128 passed" icon="circle-check">Unit, browser and visual tests.</RayTimelineItem>
<RayTimelineItem label="Upload" time="12:00:14" icon="upload" line-variant="dashed">Bundles for macOS, Linux and Windows.</RayTimelineItem>
<RayTimelineItem label="Release" time="waiting" icon="download">Publishes update.json to the stable channel.</RayTimelineItem>
</RayTimeline>
<RayStack gap="sm">
<span class="demo-muted">active is the last reached item: the bullets fill and the line colors up to it.</span>
<RayGroup gap="xs">
<RayButton size="xs" variant="default" id="demo-tl-prev">← Back</RayButton>
<RayButton size="xs" id="demo-tl-next">Advance →</RayButton>
<RayButton size="xs" variant="light" color="red" id="demo-tl-fail">Fail the upload</RayButton>
</RayGroup>
</RayStack>
</div>
<div class="demo-caption">Activity, with avatars</div>
<RayTimeline :active="3" bullet-size="28" :line-width="2" color="gray" class="demo-tl-activity">
<RayTimelineItem label="Ada merged #482" time="2 min ago"><RayAvatar slot="bullet" name="Ada Lovelace" color="pink" size="sm" />“Per-page modules” into main.</RayTimelineItem>
<RayTimelineItem label="Alan commented" time="1 h ago"><RayAvatar slot="bullet" name="Alan Turing" color="blue" size="sm" /><blockquote class="demo-tl-quote">The docs load in half the time now.</blockquote></RayTimelineItem>
<RayTimelineItem label="Grace requested a review" time="yesterday"><RayAvatar slot="bullet" name="Grace Hopper" color="teal" size="sm" />On <RayBadge variant="light" normal-case>#482</RayBadge></RayTimelineItem>
<RayTimelineItem label="Katherine opened #482" time="Oct 6"><RayAvatar slot="bullet" name="Katherine Johnson" color="orange" size="sm" />12 files changed.</RayTimelineItem>
</RayTimeline>
<div class="demo-caption">Right-aligned, colors, line variants</div>
<div class="demo-grid">
<RayTimeline :active="1" align="end" color="violet">
<RayTimelineItem label="Ordered" time="Mon 10:24" />
<RayTimelineItem label="Shipped" time="Tue 08:02" />
<RayTimelineItem label="Out for delivery" time="expected Thu" />
</RayTimeline>
<RayTimeline :active="3" bullet-size="14">
<RayTimelineItem label="v1.27.36" time="Sep 12" line-variant="dotted" />
<RayTimelineItem label="v1.27.37" time="Sep 26" />
<RayTimelineItem label="v1.27.38 (security fix)" time="Oct 1" color="red" icon="alert-triangle" />
<RayTimelineItem label="v1.27.39" time="Oct 8" />
</RayTimeline>
</div>
</template>