Timeline

Timeline

HkTimeline is the design system's step stepper: an ordered row (or column) of steps, each one completed, active or pending relative to a single current key, joined by connectors, with completed steps optionally selectable. Its indicator doubles as the position marker — a check for a step already behind you, the step number otherwise.

  • It is a step stepper, not an event feed: it shows progress through a fixed sequence. The Rust mirror's module notes say as much when they record that the retired TimelineItem event-feed shells were replaced by this stepper surface, and the older aggregate page that drew a dated event list is the shape this component is not.
  • HkTimeline is also the header HkStepFlow hosts, so a stepper that drives a swapping body belongs on StepFlow rather than assembled by hand here. The crate's separate Stepper is a different step bar — its own hk-step* class family, a plain current / total pair and no per-step names — and it is not a second name for this one.
  • The header is placed over page content; for content that stays visible while a region scrolls, the pin contract is ScrollPin.

Import

tsx
1
2
import { HkTimeline } from "@celestia-island/hikari";
import type { TimelineStep } from "@celestia-island/hikari/components/HkTimeline";
rust
1
2
use hikari_components::*;          // Timeline, TimelineProps, TimelineStep, TimelineOrientation
use hikari_components::prelude::*; // rsx!, VNode, EventHandler

The Rust form is a plain function, Timeline(TimelineProps { … }). Every prop may be omitted inside rsx!; current_key then defaults to the empty string, which matches no step and leaves every step pending — the same shape Vue has when currentKey names nothing.

The two lines of the TSX import above are worth a note because they are not symmetric. HkTimeline is re-exported from the package root, but the step types are not: the barrel exports only the component's default binding, so TimelineStep (and TimelineCollapse) come from the component's own module path, @celestia-island/hikari/components/HkTimeline, which the package's ./components/* subpath export covers. A root-level import type { TimelineStep } from "@celestia-island/hikari" fails vue-tsc with TS2305: Module '"@celestia-island/hikari"' has no exported member 'TimelineStep'.

Status from the current key

Every status is derived from current_key alone: the steps before it are completed and draw a check in the indicator, the one at it is active and carries aria-current="step", the ones after it are pending and draw their 1-based index. Only the last step is marked data-last, and every other step carries a connector after it.

orientation turns the same stepper into a column — horizontal (the default) or vertical — with the connectors following the axis.

Draft
Review
Publish
Draft
Review
Publish

Clickable steps

With clickable, a completed step that is not disabled becomes actionable: it takes data-clickable, role="button" and tabindex="0", and reports its own key when clicked or when Enter / Space is pressed on it. Nothing else listens — the active step and the pending steps take no handler at all, so the stepper can only ever move backwards into work the user has already done. In a non-clickable stepper no step is actionable, so it adds no tab stop at all.

disabled is what keeps a step out of that path without hiding it: the sample below has an Archive step that must not be visited yet, so it reads in the flow and stays unclickable. The Rust half is the same stepper with the keyboard-facing attributes in place, since a snapshot never fires the handler.

Draft
Review
Publish
Archive

The compact window, and where the two forms differ

collapse decides what the stepper does when the row does not fit its host: always renders the compact window form (the previous, current and next steps as three fixed cells, with the link overlay fading out on a side that still hides steps), never always renders the full row, and auto measures first. The window only makes sense for more steps than it can show — a timeline of three steps is its own window, and stays in full mode whatever collapse says.

[D] auto is the one column the two forms cannot share. Vue measures the row's natural width with an off-screen max-content clone under a ResizeObserver, with a 16px hysteresis before it expands again. The Rust mirror measures nothing: collapsed is a controlled prop the host reports, so auto engages the window only once the host says so. [D] nav_dir (the direction the compact window wipes from) is likewise a prop instead of an index history; None keeps data-dir absent, so nothing animates on the first render — exactly Vue's contract. [D] TimelineStep::icon exists on both types but is never rendered by either renderer; it is carried for type parity only.

Build
Review
Ship

collapse="always" is the portable form of the window: it needs no measurement, so the two samples agree without the host reporting collapsed.

API

Vue

Props

NameTypeDefaultRequired
stepsArray as PropType<TimelineStep[]>—✓
currentKeyString—✓
orientation<code>String as PropType<"horizontal" | "vertical"></code>"horizontal"—
clickableBooleanfalse—
collapseString as PropType<TimelineCollapse>"auto"—

Emits

EventPayload
selectstring

Rust

Props — Timeline

PropTypeDefaultDescription
stepsVec<TimelineStep>[]The steps, in flow order (required upstream; empty renders no steps).
current_keyString""Key of the current step (required upstream; "" matches nothing).
orientationTimelineOrientationTimelineOrientation::Horizontal—
clickableboolfalseCompleted steps become selectable (data-clickable, role="button").
collapseTimelineCollapseTimelineCollapse::Auto—
collapsedboolfalseHost-reported overflow: Vue computes this from a ResizeObserver + offscreen max-content probes; the mirror takes it as a controlled prop (see the file header's state contract).
nav_dirOption<TimelineNavDir>NoneDirection of the last step change (Vue derives it from its own index history); None keeps data-dir absent, so nothing animates.
classString""Vue attribute fallthrough onto the root <div>.
on_selectOption<EventHandler<String>>NoneFired with the step key when a completed, enabled step is activated (Vue: select).

Accessibility

  • The active step carries aria-current="step", which is what lets a screen-reader user place themselves in the flow without reading every label.
  • The indicator is aria-hidden="true" and the number or check inside it is decoration; the step's accessible name is its label text, so name steps by what they are, not by their position.
  • In a clickable stepper the completed steps take role="button", a tabindex="0" and Enter / Space handling; a step that cannot be selected is not in the tab order, so a purely informational stepper adds no keyboard stops at all.
  • A disabled step stays in the list and stays readable: it is inert, not hidden, so the flow's shape survives a gate.
  • In the compact window the link overlay is aria-hidden="true"; the three cells still carry the same statuses and the same aria-current marker, so the reduced view does not lose the semantics — only the steps that are not on screen are omitted.

Related components

  • HkStepFlow — the stepper as the header of a body that swaps between steps.
  • Stepper — the crate's other step bar: numbered boxes over a current / total pair, with no per-step names or selection.
  • HkCrossfade — the in-place dissolve for swapping views that have no step model.
  • ScrollPin — pins a header over a scroll region.
  • SectionCard — the titled panel a stepper usually sits above on a settings page.