Angular タイムライン・進捗ステップ | ng-hub-ui-milestones
Angular のタイムライン/進捗ステップコンポーネント。垂直・水平レイアウト、完全にカスタマイズ可能なノード、各ステップの内側と横のコンテンツ、CSS 変数テーマに対応します。
最終更新 2026/09/16
概要
チームがこのライブラリを探す理由
オンボーディングフロー、注文追跡、ロードマップなど、カスタムノードと垂直・水平両方のレイアウトを備えた表示用の進捗トラッカーが必要なとき、この Angular タイムラインコンポーネントを選んでください。
インストール
npm install ng-hub-ui-milestonesジャンプ
最適な用途
- オンボーディングフロー
- 注文追跡
- ロードマップ
- プロセスのステップ
について milestones
ng-hub-ui-milestones は、レールでつながれた一連のステップを垂直または水平に配置します。各ノードは完全にカスタマイズ可能で、円の中に番号・アイコン・アバターや任意のマークアップを配置でき、横にはリッチなコンテンツを置けます。すべての色・サイズ・コネクターは CSS 変数なので、ランタイムでテーマを再設定できます。
機能ガイド
向き
タイムラインを縦方向(デフォルトで、ウィザードやアクティビティフィードに最適)または横方向(ページ上部に進捗ステップを並べる)にレイアウトします。ノードは DOM の順序で自動的に採番されます。
サンプル:
縦型タイムライン
縦型タイムライン
Information
Account details captured and verified.
Shipping
Delivery address confirmed.
Payment
Enter your payment method to continue.
Review
Place the order once everything looks right.
横型進行ステップ
横型進行ステップ
Information
Account verified.
Shipping
Address confirmed.
Payment
In progress.
Review
Last step.
ノードの状態
各 `hub-milestone` は `state`(complete、active、pending、error)を持ち、これがノードとコネクターの色を駆動します。`label` 入力は円の内側にフォールバックテキストをレンダリングします。
サンプル:
ノードの状態
ノードの状態
Complete
A finished step. Announced as “Completed”.
Active
The current step, highlighted with a ring and carrying aria-current="step".
Error
Something needs attention here. The mark on the circle says so without colour, and the step is announced as “Error”.
Pending
Not started yet — and announced as “Sin empezar”, because this node sets stateLabel.
カスタムノード&テーマ設定
`<ng-template hubMilestoneNode>` で任意のコンテンツ(数字、アイコン、絵文字、アバター)を円内に投影したり、`color` で単一のノードをオーバーライドしたり、`--hub-milestone-*` CSS 変数でタイムライン全体のテーマを変更したりできます。
サンプル:
カスタムノード & ノードごとの色
カスタムノード & ノードごとの色
Drafted
Article written and saved.
Reviewed
Approved by the editor.
Publishing
Going live across channels.
Promotion
Scheduled for next week.
CSS 変数によるテーマ設定
CSS 変数によるテーマ設定
Kickoff
Project scoped and approved.
Build
Core features shipped.
Launch
Rolling out to production.
アニメーション
タイムラインがビューポートに入ると、アクセントの線がアクティブノードまで完成します(デフォルトで有効、`provideHubMilestones` でグローバルに設定可能)。`[pulse]` を追加すると、アクティブノードが柔らかな波を放ちます。どちらのアニメーションも `prefers-reduced-motion` を尊重します。
サンプル:
アクティブパルス付きの横型
アクティブパルス付きの横型
Ordered
Payment received.
Packed
Ready to ship.
In transit
Out for delivery now.
Delivered
Arriving soon.
主な機能
最近の変更
Version 22.5.1 - 9/16/26, 12:00 AM
changed: Repository, issue and README links follow the move to the hub-env organization. Issues for every Hub UI package are now gathered in hub-env/hub-ui, and the repository and bugs fields of the manifest point at the new addresses. No code, types or styles change.
Version 22.5.0 - 9/8/26, 12:00 AM
added: A milestone in error is no longer distinguishable by colour alone. It was a red circle and nothing else, and the rail carries aria-hidden="true", so the state reached nobody who does not separate red from green. Every node now renders its state as a word in the body, clipped out of the page and read out with the step, and an error node additionally draws a light mark on its circle that survives greyscale.
added: stateLabel on hub-milestone and stateLabels in HubMilestonesConfig: the announced word is English by default (Completed, Pending, Error, and nothing for active, which aria-current already names), and these two are how it gets translated. The per-node input wins over the application-wide option, and '' silences one node or one state.
added: data-state on hub-milestone, mirroring the state the modifier classes already carry — the same attribute hook toast, badges and stepper expose for styling and for tests.
changed: The node body now contains one clipped span before the projected content. Nothing moves on screen and no API changes, but a test asserting on the exact textContent of a milestone body will see the state word alongside its own copy.
Version 22.4.0 - 9/7/26, 12:00 AM
fixed: A :root in the application now outranks the library's token defaults. The component is unencapsulated, so its :root block of --hub-milestone-* defaults lands in the global stylesheet with the same specificity as the application's own :root, and the tie goes to whichever sheet was injected last — the component's, always. Wrapped in :where() the defaults score zero, so the consumer's rule wins on merit and nothing needs !important. Same tokens, same values; only what wins changed.
changed: The Styling section of both READMEs says where a redefinition actually lands. It listed :root, a hub-milestones selector and the per-node color input as equivalent, when the first of the three did nothing.
Version 22.3.3 - 9/6/26, 12:00 AM
fixed: The documentation no longer denies the ng-hub-ui-utils dependency the package requires. Both READMEs advertised zero runtime dependencies and an install line naming this package alone, while peerDependencies has demanded ng-hub-ui-utils since 22.3.0, so a reader installing by hand ended up with an application that cannot resolve resolveHubAccent. The install block now names both packages and states the peer range.
fixed: hubMilestoneNode is described as what it is: an attribute directive. Calling it structural set the wrong expectation about where its content appears. It only tags a template, and hub-milestone is what renders it inside the circle.
fixed: HUB_MILESTONES_CONFIG is in the API reference. The token is exported from public-api.ts and is the only way to read the resolved application defaults, yet neither README named it.
fixed: The Styling section documents the SCSS the package ships. The theming mixin and the styles entry point have been published since 22.2.0 with no trace in either README, leaving the one-call theming path visible only to whoever read the changelog.
Version 22.3.2 - 9/1/26, 12:00 AM
changed: The homepage in the manifest points at this library's own documentation page rather than at the site root. It is the link a registry shows beside the package and the one a reader clicks from it, and landing on a front page they then have to search is a worse answer than landing on the reference for the package they were already looking at. Metadata only — no code, no types, no styles change, and nothing a consumer imports is affected.
Version 22.3.1 - 8/8/26, 12:00 AM
fixed: Documentation links now point at the canonical localized URLs. The README linked to https://hubui.dev/<path> with no locale prefix and no trailing slash, and both forms are 301-redirected, so every reader arriving from npm or GitHub landed on a redirect instead of the canonical page.
Version 22.3.0 - 7/28/26, 12:00 AM
changed: Accent resolution now imports the canonical resolveHubAccent from ng-hub-ui-utils. The private copy under src/lib/shared/resolve-hub-accent.ts has been deleted in favour of the single, tested implementation shared family-wide. Behaviour is identical (the copy had not diverged): a bareword resolves to var(--hub-sys-color-<name>, <name>), a literal colour passes through unchanged, an empty value yields null.
added: NEW peer dependency: ng-hub-ui-utils >=22.7.0. Consumers must have ng-hub-ui-utils installed alongside this library (it is where resolveHubAccent lives). Users installing via ng add ng-hub-ui get it automatically; manual installs need npm i ng-hub-ui-utils.
Version 22.2.1 - 7/28/26, 12:00 AM
fixed: Each milestone exposes role=listitem and the active node announces aria-current=step, completing the list semantics the container already declared.
Version 22.2.0 - 7/7/26, 12:00 AM
added: hub-milestones-theme(...) SCSS mixin — one-call token theming for <hub-milestones>, covering the full --hub-milestone-* surface: completed steps ($node-color, $node-text, $node-size, $node-font-size, $connector-bg, $connector-thickness), upcoming steps ($pending-bg, $pending-border, $pending-color, $connector-pending-bg), the error state ($error-bg), the step body ($body-color, $body-muted) and layout ($gap, $spacing). Every parameter is null-defaulted and additive.
changed: Packaging — the library now ships its SCSS at /styles. src/lib/styles is emitted to dist/milestones/styles, exposing hub-milestones-theme as a first-class package entry: @use 'ng-hub-ui-milestones/styles' as *;
Version 22.1.0 - 7/7/26, 12:00 AM
changed: <hub-milestone> color accepts ANY colour. On top of the built-in semantic accents, the input now also accepts a registered custom accent and a literal colour (#ff0000, rgb(...), oklch(...), a CSS named colour), resolved through the shared resolveHubAccent resolver: a bareword becomes var(--hub-sys-color-<name>, <name>); a literal is used as-is. Built-in colours are unchanged.
changed: Internal — host bindings moved to the host metadata object. @HostBinding / @HostListener decorators were replaced by the host object in the component and directive metadata (Angular style guide). No public API or behaviour change.
Version 22.0.3 - 6/25/26, 12:00 AM
changed: Widened the Angular peer dependency range from ^22.0.0 to >=21.0.0, so the library installs on Angular 21 projects as well, aligning it with the rest of the ng-hub-ui family. No code changes.
Version 22.0.2 - 6/25/26, 12:00 AM
added: Viewport reveal — when a <hub-milestones> scrolls into view it plays a one-shot animation, filling the accent trail from the first node up to the active node. On by default; set it globally with provideHubMilestones({ reveal: false }) or per instance with [reveal]. Tunable via --hub-milestone-reveal-duration / --hub-milestone-reveal-stagger, SSR-safe and disabled under prefers-reduced-motion.
added: provideHubMilestones() provider and HubMilestonesConfig for app-wide defaults, plus the [pulse] input on <hub-milestones> — an opt-in soft wave on the active node whose colour follows the node accent and is overridable via --hub-milestone-pulse-color / --hub-milestone-pulse-duration / --hub-milestone-pulse-spread.
fixed: Connectors now reach from node to node: the connector is absolutely positioned and always spans node edge to next-node edge, in both orientations. Its colour follows the theme accent (--hub-milestone-node-color) instead of the hardcoded purple-to-orange gradient, the accent trail stops at the active node so the timeline reads as a real progress indicator, and layout, connectors and the reveal flip correctly under dir='rtl'.
Version 22.0.1 - 6/25/26, 12:00 AM
fixed: Design-token consistency pass: aligned inline fallback defaults with the canonical ng-hub-ui-ds values and routed hardcoded literals (z-index, font-weight, line-height, radii and theme-aware colours) through their --hub-sys-* / --hub-ref-* tokens, so they follow the active theme. No visual change when the ds tokens are loaded.
Version 22.0.0 - 6/17/26, 12:00 AM
changed: Aligned with Angular 22. README documentation standardized.
Version 21.0.0 - 6/14/26, 12:00 AM
added: Initial release: hub-milestones container (vertical / horizontal orientation, auto-numbered nodes) and hub-milestone node with complete/active/pending/error states.
added: Per-node color override, label fallback and custom in-circle content via the hubMilestoneNode template directive.
added: Full --hub-milestone-* CSS-variable theming for node, connector, states and spacing.
関連ライブラリ
よくある質問
Angular でタイムラインコンポーネントを作るには?
ng-hub-ui-milestones をインストールし、HubMilestonesComponent にステップの一覧を渡します。レールとノードを描画して各ステップの状態を示すため、注文の追跡、オンボーディングの流れ、プロジェクトのロードマップなど、タイムラインが操作対象ではなく表示物である場面に向いています。
タイムラインを縦ではなく横にできますか?
はい。HubMilestonesOrientation は入力ひとつでレイアウト全体を縦横に切り替え、同じステップの内容がどちらでも使えます。デスクトップではサイドバー、狭い画面では横帯という使い分けに便利です。
タイムラインの各ノードに独自の内容を入れるには?
HubMilestoneNodeDirective は各ステップの丸を置き換えるので、ノードを数字、アイコン、アバター、任意のマークアップにできます。ノードの横にリッチな内容を置くこともでき、日付・説明・アクションをステップに添えられます。
Angular におけるタイムラインとステッパーの違いは?
タイムラインはすでに起きた、あるいは予定された進行を示すもので、ユーザーが進めるものではありません。ステッパーはフォームやウィザードを各ステップの検証つきで案内します。並びを見せるなら ng-hub-ui-milestones、ユーザーが進める必要があるなら ng-hub-ui-stepper を使ってください。