Showcase
Five timelines the way an app would use them, each live. The home page has a sixth, a chronicle restyled entirely from outside, with a story, a camera and an editable history; these are the other shapes a timeline takes. Open The code under any of them to read and edit it.
A product launch of 313 tasks
Live demo: A product launch: 300 tasks, dependencies, the critical path, team load, undo
Loading…
The code
Run “A product launch: 300 tasks, dependencies, the critical path, team load, undo” on your own machine
Make an empty folder and put this example’s two files in it:
index.html— the page the code runs in, its markup and styles:<style> .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #d5d9de; } .bar button { padding: 3px 10px; border: 1px solid #8a939d; border-radius: 4px; background: #fff; } .bar button[aria-pressed="true"] { background: #1b1f24; color: #fff; } .bar button:disabled { opacity: 0.45; } .bar output { margin-left: auto; font-size: 12px; color: #444c55; } .plan { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 470px; } .plan.narrow { grid-template-columns: minmax(0, 1fr); } #timeline { height: 470px; } #load { height: 230px; border-top: 1px solid #d5d9de; } /* The whole explanation, never a box that scrolls: a scrolling region would need a keyboard stop of its own. */ #log { max-height: none; } #timeline .critical { --tl-item-fill: #f4a097; --tl-item-stroke: #b3261e; stroke-width: 1.5px; } </style> <div class="bar"> <button type="button" id="schedule">Reschedule</button> <button type="button" id="undo" disabled>Undo</button> <button type="button" id="redo" disabled>Redo</button> <button type="button" id="team" aria-pressed="false" aria-controls="load">Team load</button> <output id="status" aria-live="polite"></output> </div> <div class="plan" id="plan"> <div id="grid"></div> <div id="timeline"></div> </div> <div id="load" hidden></div> <p class="log" id="log">Drag a task later, or focus one and press Alt + →. The bars outlined in red are the critical path: a day lost there is a day lost at launch. Reschedule pushes the successors back in order; Ctrl + Z undoes.</p>main.js— the code, as it is in the editor now, your edits included:In a terminal in that folder, install the library and Vite (it lets the browser follow the
imports), then start it:npm init -y npm install @temporeum/timeline-element @temporeum/timeline-core npm install --save-dev vite npx viteOpen the address it prints,
http://localhost:5173/.
A product launch of 313 tasks in twelve streams, drawn as a Gantt chart: dependencies, baselines, progress and milestones from the Gantt plugin, the critical path and the reschedule from the scheduler, the team's load from the resource view. Every edit is a command, so Undo is exact. On a phone it turns vertical.
A chronology across five thousand years
Live demo: Five thousand years down to the minute: one chronology, one zoom
Loading…
The code
Run “Five thousand years down to the minute: one chronology, one zoom” on your own machine
Make an empty folder and put this example’s two files in it:
index.html— the page the code runs in, its markup and styles:<style> .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #d5d9de; } .bar button { padding: 3px 10px; border: 1px solid #8a939d; border-radius: 4px; background: #fff; } .bar button[aria-pressed="true"] { background: #1b1f24; color: #fff; } #timeline { height: 470px; } </style> <div class="bar" role="group" aria-label="Zoom to"> <button type="button" data-zoom="all" aria-pressed="false">5 000 years</button> <button type="button" data-zoom="antiquity" aria-pressed="true">Antiquity</button> <button type="button" data-zoom="modern" aria-pressed="false">Since 1450</button> <button type="button" data-zoom="apollo" aria-pressed="false">Apollo 11, 8 days</button> <button type="button" data-zoom="landing" aria-pressed="false">The landing, 12 hours</button> </div> <div id="timeline"></div> <p class="log" id="log" aria-live="polite">One timeline from the first pharaohs to the Moon: zoom with ctrl + wheel, a pinch or + and -, or jump with the buttons. The axis changes from millennia to minutes on the way.</p>main.js— the code, as it is in the editor now, your edits included:In a terminal in that folder, install the library and Vite (it lets the browser follow the
imports), then start it:npm init -y npm install @temporeum/timeline-element @temporeum/timeline-core npm install --save-dev vite npx viteOpen the address it prints,
http://localhost:5173/.
One timeline from the unification of Egypt to the Moon landing, zoomable from five millennia down to the minutes of Apollo 11. The axis switches from millennia to minutes on the way, in BC and AD through formatTick; eras are decorations, and the eight days of Apollo 11 become one marker with a count while you look at the whole span (clustering). The dates before 1500 are approximate or traditional.
A live log of 100 000 entries
Live demo: A live log: a new entry every second, and a day of 100 000 loaded by window
Loading…
The code
Run “A live log: a new entry every second, and a day of 100 000 loaded by window” on your own machine
Make an empty folder and put this example’s two files in it:
index.html— the page the code runs in, its markup and styles:<style> .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #d5d9de; } .bar button { padding: 3px 10px; border: 1px solid #8a939d; border-radius: 4px; background: #fff; } .bar button[aria-pressed="true"] { background: #1b1f24; color: #fff; } .bar output { margin-left: auto; font-size: 12px; color: #444c55; } #timeline { height: 400px; } #timeline .level-error { --tl-item-fill: #f2b8b5; --tl-item-stroke: #b3261e; } #timeline .level-warn { --tl-item-fill: #f9dfa0; --tl-item-stroke: #8a5a00; } #timeline .level-info { --tl-item-fill: #c6dbf7; --tl-item-stroke: #2a5ca8; } </style> <div class="bar"> <button type="button" data-level="error" aria-pressed="true">Errors</button> <button type="button" data-level="warn" aria-pressed="true">Warnings</button> <button type="button" data-level="info" aria-pressed="true">Info</button> <span role="group" aria-label="What to show"> <button type="button" data-mode="live" aria-pressed="true">Live: the last hour</button> <button type="button" data-mode="day" aria-pressed="false">The whole day</button> </span> <button type="button" id="follow" aria-pressed="true">Follow</button> <output id="count" aria-live="off"></output> </div> <div id="timeline"></div> <p class="log" id="log" aria-live="polite"></p>main.js— the code, as it is in the editor now, your edits included:In a terminal in that folder, install the library and Vite (it lets the browser follow the
imports), then start it:npm init -y npm install @temporeum/timeline-element npm install --save-dev vite npx viteOpen the address it prints,
http://localhost:5173/.
A day of a made-up service's log: 100 000 entries in five lanes, and a new one about every second through addItems — no reload, and the layout repacks only the lane an entry lands in (async and live data). Zoom out to the whole day: entries too close to tell apart cluster. The levels are filtered by the page, which hands the timeline what to draw.
An editable roadmap, by keyboard
Live demo: An editable roadmap, on a phone too, and every edit by keyboard
Loading…
The code
Run “An editable roadmap, on a phone too, and every edit by keyboard” on your own machine
Make an empty folder and put this example’s two files in it:
index.html— the page the code runs in, its markup and styles:<style> .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; height: 420px; } .wrap.narrow { grid-template-columns: minmax(0, 1fr); grid-template-rows: 300px auto; height: auto; } #timeline { height: 100%; min-height: 300px; } .tour { border-left: 1px solid #d5d9de; padding: 8px 12px; overflow: auto; font-size: 13px; } .narrow .tour { border-left: 0; border-top: 1px solid #d5d9de; } .tour h2 { font-size: 14px; margin: 0 0 6px; } .tour ol { margin: 0; padding-left: 1.3em; } .tour li { margin: 0 0 6px; } .tour li[data-done]::marker { content: "✓ "; color: #1a7f37; } .tour li[data-done] { color: #1a7f37; } kbd { border: 1px solid #8a939d; border-radius: 3px; padding: 0 3px; font: 12px ui-monospace, Menlo, monospace; } #timeline .status-done { --tl-item-fill: #c8e6c9; } #timeline .status-now { --tl-item-fill: #c6dbf7; } #timeline .status-later { --tl-item-fill: #e4e7eb; } </style> <div class="wrap" id="wrap"> <div id="timeline"></div> <section class="tour" aria-labelledby="tour-title"> <h2 id="tour-title">Keyboard only — try it</h2> <ol id="steps"> <li data-step="focus">Press <kbd>Tab</kbd> until the roadmap has focus.</li> <li data-step="walk">Walk the items with <kbd>←</kbd> <kbd>→</kbd> and <kbd>↑</kbd> <kbd>↓</kbd>.</li> <li data-step="move">Move one a week later with <kbd>Alt</kbd> + <kbd>→</kbd>.</li> <li data-step="lane">Move it to another team with <kbd>Alt</kbd> + <kbd>↓</kbd>.</li> <li data-step="resize">Make it longer with <kbd>Shift</kbd> + <kbd>→</kbd>.</li> <li data-step="undo">Take it all back with <kbd>u</kbd>, one step at a time.</li> </ol> <p id="said" aria-live="polite"></p> </section> </div>main.js— the code, as it is in the editor now, your edits included:In a terminal in that folder, install the library and Vite (it lets the browser follow the
imports), then start it:npm init -y npm install @temporeum/timeline-element npm install --save-dev vite npx viteOpen the address it prints,
http://localhost:5173/.
A product's year in four teams. Drag a bar to move it, across teams too, or drag its end; the tour beside it does the same with keys only, and ticks each step off by what the timeline reports. Every edit is one command whose inverse is the undo (editing, accessibility). On a phone the roadmap turns vertical and the tour goes under it (responsive).
A story, slide by slide
Live demo: A story told slide by slide: the race to the Moon, from TimelineJS's JSON
Loading…
The code
Run “A story told slide by slide: the race to the Moon, from TimelineJS's JSON” on your own machine
Make an empty folder and put this example’s two files in it:
index.html— the page the code runs in, its markup and styles:<style> .stage { display: grid; grid-template-rows: 390px 214px; height: 618px; } #story { min-height: 0; } #timeline { height: 100%; border-top: 1px solid #d5d9de; } @media (max-width: 640px) { .stage { grid-template-rows: 430px 174px; } } </style> <div class="stage"> <div id="story"></div> <div id="timeline"></div> </div> <p class="log" id="status" aria-live="polite">Page with Previous and Next, ← and →, or pick an event on the timeline.</p>main.js— the code, as it is in the editor now, your edits included:In a terminal in that folder, install the library and Vite (it lets the browser follow the
imports), then start it:npm init -y npm install @temporeum/timeline-element @temporeum/timeline-core npm install --save-dev vite npx viteOpen the address it prints,
http://localhost:5173/.
The race to the Moon in nineteen moments, written in TimelineJS's own JSON and loaded as it is (fromTimelineJS): a slide at a time above, the timeline under it, in a lane per country and three eras. Previous and Next — or ← and → — move the timeline to the slide; picking an event on the timeline opens its slide. Zoom in on July 1969 and the landing is at its minute (storytelling, migrating from TimelineJS).