Timeline
Dated events in order — an activity feed, a changelog, an order's steps: a list for screen readers, one tab stop, the arrow keys between events.
Usage
Usage
Deployed to production
Version 2.4.1 is live in every region.
Checks passed
312 tests and the bundle size budget.
Pull request merged
Ada merged Cache search results into main.
Review requested
Grace and Linus were asked to review.
import { Component, ViewEncapsulation } from '@angular/core';import { ScTimeline, ScTimelineConnector, ScTimelineDescription, ScTimelineItem, ScTimelineMarker, ScTimelineTime, ScTimelineTitle,} from '@semantic-components/ui';Anatomy
Every part inside an event is optional: a marker on the line, the line to the next event, a title, a time, a description — and anything of yours (a link, a collapsible).
import { ScTimeline, ScTimelineItem, ScTimelineMarker, ScTimelineConnector, ScTimelineOpposite, ScTimelineTitle, ScTimelineTime, ScTimelineDescription,} from '@semantic-components/ui';<div scTimeline aria-label="Activity"> <div scTimelineItem> <span scTimelineMarker></span> <span scTimelineConnector></span> <div scTimelineOpposite>…</div> <h3 scTimelineTitle>Deployed to production</h3> <time scTimelineTime [value]="deployedAt"></time> <p scTimelineDescription>Version 2.4.1 is live.</p> </div></div>Status
For a process, give each event a status: complete, current, upcoming or failed. Its marker is filled, ringed, muted or in the destructive colour, the line after a complete event is the primary colour, and the current event is the step (aria-current) where focus starts. Style by state from the item's data-complete, data-current, data-upcoming, data-failed, data-first and data-last; --sc-timeline-index numbers the events, --sc-timeline-count counts them, --sc-timeline-marker sizes the markers.
Accessibility
- A list (a feed with
feed, its events articles): name it. Each event is named by its title and described by its time and description; markers and lines are hidden. - One tab stop: Tab enters on the current event, else the first, then on the one focused last. ↑↓ move between events (←→ across, mirrored right to left), Home and End to the first and last; Tab goes on to the links and buttons inside an event.
- In a feed, Page Up and Page Down move between articles from anywhere in one; it is busy while more load.
- A status shown only by the marker is seen, not read: say it in the title or description too.
- Put the time in a
<time>with its datetime: machine-readable, its text in your words.
Examples
Horizontal
Kickoff
Design review
Beta
Launch
import { Component, ViewEncapsulation } from '@angular/core';import { ScTimeline, ScTimelineConnector, ScTimelineItem, ScTimelineMarker, ScTimelineTime, ScTimelineTitle,} from '@semantic-components/ui';Alternate
Founded
Two people and a spare room.
First release
Version 1.0, for a hundred teams.
A thousand customers
And an office with windows.
Version 2
Rewritten from the ground up.
import { Component, ViewEncapsulation } from '@angular/core';import { ScTimeline, ScTimelineConnector, ScTimelineDescription, ScTimelineItem, ScTimelineMarker, ScTimelineOpposite, ScTimelineTime, ScTimelineTitle,Status
Order placed
Done
Packed
Done
Shipped
On its way
Delivered
Expected
import { Component, ViewEncapsulation } from '@angular/core';import { ScButton, ScTimeline, ScTimelineConnector, ScTimelineDescription, ScTimelineItem, ScTimelineMarker, ScTimelineTime, ScTimelineTitle,Failure
Build
Done in 48 seconds.
Tests
Failed: 2 of 312 tests.
Deploy
Waiting for the tests to pass.
import { Component, ViewEncapsulation } from '@angular/core';import { ScTimeline, ScTimelineConnector, ScTimelineDescription, ScTimelineItem, ScTimelineMarker, ScTimelineTitle,} from '@semantic-components/ui';import { SiCheckIcon, SiXIcon } from '@semantic-icons/lucide-icons';Collapsible changes
Version 2.4
- Search results are cached.
- Faster cold starts.
Version 2.3
- A dark theme.
- Keyboard shortcuts in the editor.
Version 2.2
- Exports to CSV.
- A fix for long file names.
import { Component, ViewEncapsulation } from '@angular/core';import { ScButton, ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTimeline, ScTimelineConnector, ScTimelineItem, ScTimelineMarker,Feed
Fixed the flaky upload test
Wrote the release notes
import { Component, ViewEncapsulation, computed, signal } from '@angular/core';import { ScButton, ScTimeline, ScTimelineConnector, ScTimelineItem, ScTimelineMarker, ScTimelineTime, ScTimelineTitle,} from '@semantic-components/ui';RTL
الانطلاق
مراجعة التصميم
النسخة التجريبية
الإطلاق
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScTimeline, ScTimelineConnector, ScTimelineItem, ScTimelineMarker, ScTimelineTime, ScTimelineTitle,} from '@semantic-components/ui';API reference
Each part takes class, merged over its own (cn: a later class wins).
| Part | Selector | Description |
|---|---|---|
ScTimeline | [scTimeline] | A list (a feed with feed), named by you; one tab stop for its events. exportAs scTimeline: focus(value?). |
ScTimelineItem | [scTimelineItem] | An event: a list item (an article in a feed), named by its title, described by its time and description; aria-current="step" when current. |
ScTimelineMarker | [scTimelineMarker] | The dot on the line, or your icon in it: filled, ringed when current, muted when upcoming. Hidden. |
ScTimelineConnector | [scTimelineConnector] | The line to the next event: primary after a complete one, none after the last. Hidden. |
ScTimelineOpposite | [scTimelineOpposite] | Across the line from the content — a date, a year: on the other side (vertical; the line stays straight), above the content (across). |
ScTimelineTitle | [scTimelineTitle] | The event’s title, on your heading: names the event. |
ScTimelineTime | time[scTimelineTime] | Your <time>: [value] a Temporal date or moment, written in the locale (options), its datetime set — or your words with a datetime. Describes the event. |
ScTimelineDescription | [scTimelineDescription] | What happened, in more words. Describes the event. |
| Input | Type | Default | Description |
|---|---|---|---|
alignment | 'start' | 'end' | 'alternate' | 'start' | Vertical: the events after the line, before it, or in turn (the line in the middle). |
orientation | 'vertical' | 'horizontal' | 'vertical' | Which way the events run, and which arrows move; across, it scrolls when narrow. |
loop | boolean | true | The arrows wrap from the last event to the first. |
feed | boolean | false | A feed of articles that loads more. |
busy | boolean | false | Loading more (aria-busy), in a feed. |
| Input | Type | Default | Description |
|---|---|---|---|
status | 'complete' | 'current' | 'upcoming' | 'failed' | none | Where it is in a process. |
value | string | generated | Names the event for focus(value). |