@molecule/app-status-timeline-angular

Feature · status-timeline · App (browser) · v1.1.3 · Apache-2.0

Vertical ordered-step status timeline: dots colored by reached state, current step bolded — generic for orders, workflows, kanban progressions

npm install @molecule/app-status-timeline-angular

npm · Source on GitHub

How it works

@molecule/app-status-timeline-angular is a ready-made status-timeline feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { Component } from '@angular/core'
import { StatusTimeline } from '@molecule/app-status-timeline-angular'

@Component({
  selector: 'order-progress',
  standalone: true,
  imports: [StatusTimeline],
  template: `
    <ol
      mol-status-timeline
      [steps]="steps"
      [currentKey]="'shipped'"
      [ariaLabel]="'Order status'"
    ></ol>
  `,
})
export class OrderProgress {
  steps = [
    { key: 'placed', label: 'Order Placed' },
    { key: 'processing', label: 'Processing' },
    { key: 'shipped', label: 'Shipped' },
    { key: 'delivered', label: 'Delivered' },
  ]
}

Works with: @molecule/app-angular, @molecule/app-ui, @molecule/app-ui-angular

Reference

Angular vertical ordered-step status timeline.

Exports <StatusTimeline> — render a list of steps with colored dots indicating reached state and bolded label on the current step. Generic for orders, workflows, kanban progressions, etc. It is the Angular counterpart of @molecule/app-status-timeline-react: same props and the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { Component } from '@angular/core'
import { StatusTimeline } from '@molecule/app-status-timeline-angular'

@Component({
  selector: 'order-progress',
  standalone: true,
  imports: [StatusTimeline],
  template: `
    <ol
      mol-status-timeline
      [steps]="steps"
      [currentKey]="'shipped'"
      [ariaLabel]="'Order status'"
    ></ol>
  `,
})
export class OrderProgress {
  steps = [
    { key: 'placed', label: 'Order Placed' },
    { key: 'processing', label: 'Processing' },
    { key: 'shipped', label: 'Shipped' },
    { key: 'delivered', label: 'Delivered' },
  ]
}

Type

feature

Installation

npm install @molecule/app-status-timeline-angular @angular/common @angular/core @angular/platform-browser @molecule/app-angular @molecule/app-ui @molecule/app-ui-angular

API

Interfaces

StatusTimelineStep

A single step entry in a StatusTimeline.

interface StatusTimelineStep {
  /** Stable identifier for this step (used as the `@for` track key). */
  key: string
  /** Visible label. Apps that route this through `t(...)` should pass the resolved string. */
  label: string
}

StatusTimelineProps

Props accepted by StatusTimeline — the same props @molecule/app-status-timeline-react accepts.

interface StatusTimelineProps {
  /** Ordered list of steps from earliest to latest. */
  steps: ReadonlyArray<StatusTimelineStep>
  /** The key of the current step. Steps with the same or earlier index are shown as "reached". */
  currentKey: string
  /** Aria-label for the timeline ordered list. */
  ariaLabel?: string
  /** Extra classes on the outer `<ol>`. */
  className?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
}

Classes

StatusTimeline

StatusTimeline component.

Vertical ordered-step status timeline: each step renders as a colored dot

  • label; steps at or before the current one are "reached" (filled dot); the current step's label is bolded; later steps are dimmed via cm.textMuted. The host IS the outer <ol> (ol[mol-status-timeline]), matching React's root exactly, and the rows are tracked by the step's key value (@for (…; track step.key)), like React's per-item keys.

This is the Angular counterpart of @molecule/app-status-timeline-react: the same props (React names), the same ClassMap tokens, and the same DOM for the same input.

@Component({
  selector: 'ol[mol-status-timeline]',
  standalone: true,
  inputs: ['steps', 'currentKey', 'ariaLabel', 'className', 'dataMolId'],
  host: {
    '[class]': 'classes()',
    '[attr.aria-label]': 'ariaLabel ?? null',
    '[attr.data-mol-id]': 'dataMolId ?? null',
  },
  template: `@for (step of steps; track step.key; let i = $index) {
    <li [class]="cm().flex({ align: 'center', gap: 'sm' })">
      <span
        [class]="
          cm().cn(
            cm().roundedFull,
            cm().statusTimelineDot,
            reached(i) ? cm().bgPrimary : cm().statusTimelineDotIdle
          )
        "
        aria-hidden="true"
      ></span>
      <span
        [class]="
          cm().cn(reached(i) ? '' : cm().textMuted, isCurrent(i) ? cm().fontWeight('semibold') : '')
        "
        >{{ step.label }}</span
      >
    </li>
  }`,
})
export class StatusTimeline {
  /** Ordered list of steps from earliest to latest. */
  steps: ReadonlyArray<StatusTimelineStep> = []
  /** The key of the current step. */
  currentKey?: string
  /** Aria-label for the timeline ordered list. */
  ariaLabel?: string
  /** Extra classes on the outer `<ol>`. */
  className?: string
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string

  /**
   * The current class map.
   * @returns The UIClassMap.
   */
  cm(): UIClassMap {
    return getClassMap()
  }

  /**
   * The index of the current step (its key's position), or -1 when no step matches.
   * @returns The current index.
   */
  currentIdx(): number {
    return this.steps.findIndex((s) => s.key === this.currentKey)
  }

  /**
   * Computes the outer `<ol>` class list.
   * @returns The class string.
   */
  classes(): string {
    return this.cm().cn(this.cm().statusTimelineList, this.cm().textSize('sm'), this.className)
  }

  /**
   * Whether the step at `i` is at or before the current one.
   * @param i - The step's index.
   * @returns Whether the step is reached.
   */
  reached(i: number): boolean {
    return this.currentIdx() >= 0 && i <= this.currentIdx()
  }

  /**
   * Whether the step at `i` is the current one.
   * @param i - The step's index.
   * @returns Whether the step is current.
   */
  isCurrent(i: number): boolean {
    return i === this.currentIdx()
  }
}

Injection Notes

Requirements

Peer dependencies:

  • @angular/common ^22.0.0
  • @angular/core ^22.0.0
  • @angular/platform-browser ^22.0.0
  • @molecule/app-angular ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.3.11
  • @molecule/app-ui-angular ^1.1.0

Runtime Dependencies

  • @angular/common

  • @angular/core

  • @angular/platform-browser

  • @molecule/app-angular

  • @molecule/app-ui

  • @molecule/app-ui-angular

  • Requires a wired ClassMap bond (getClassMap() throws before bonding). No i18n dependency — pass pre-translated label strings and a translated ariaLabel.

  • If currentKey matches no step, EVERY step renders as unreached — there is no error; double-check the key values.

  • Reached dots use bg-primary (works with the scaffold theme); unreached dots use bg-outline-variant and row spacing uses space-y-2 — both are Material-3/raw utilities that the minimal scaffold theme does not generate, so unreached dots can be invisible and rows unspaced outside flagship-derived themes.

  • Vertical list only; for a horizontal stage rail use @molecule/app-stage-timeline-angular.