Angular 步骤条组件 | ng-hub-ui-stepper

Angular 步骤条组件,支持校验、朝向模式、自定义控件、i18n 和 CSS 变量主题。

最后更新 2026年8月14日

概览

团队为何搜索这个库

这个 Angular 步骤条组件适用于引导式多步流程,在这些流程中校验、推进规则和品牌需要始终在你的掌控之中。

安装

npm install ng-hub-ui-stepper

跳转到

适用于

  • 结账流程
  • 向导表单
  • 入门引导
  • 配置步骤

关于 stepper

ng-hub-ui-stepper 帮助 Angular 应用构建入门引导、结账和向导式表单。它为团队提供了一种可复用的方式来控制步骤推进、校验和导航逻辑,而无需在每个流程中手动写死这些规则。

功能指南

核心用法

基础设置和方向行为。

示例:
基本用法

基本用法

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

方向

方向

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

截断标题与提示

截断标题与提示

Long step titles are clipped to an ellipsis. Hover the nav title above to read the full text.

高级流程

验证、i18n、RTL、API 驱动的导航、自定义控件和自定义步骤头部。

示例:
校验

校验

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

程序化控制

程序化控制

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

Event: -

自定义导航

自定义导航

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

自定义控件

自定义控件

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

动画

动画

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

国际化(i18n)

国际化(i18n)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

从右到左(RTL)

从右到左(RTL)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

样式

通过主题服务进行运行时主题自定义。

示例:
主题

主题

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus.

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus.

核心特性

最近更改

Version 22.8.0 - 8/14/26, 12:00 AM

changed: Default action labels now resolve HUBUI.STEPPER.* before the legacy flat keys. The component provides the namespace through HUB_TRANSLATION_PREFIX, so an application dictionary can feed the built-in navigation labels via provideHubTranslationAdapter() without reserving generic top-level keys. Existing flat dictionaries keep working — the bare key is still the fallback.

added: README documentation for the application-wide translation adapter (provideHubTranslationAdapter() from ng-hub-ui-utils).

removed: Removed the @angular/animations peer dependency. The package is deprecated upstream and the library never used it. Applications that installed it only for ng-hub-ui-stepper can drop it.

Version 22.7.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.7.0 - 7/29/26, 12:00 AM

added: --hub-stepper-indicator-size — the canonical step-indicator diameter (calc(var(--hub-ref-space-3, 1rem) * 2)). The built-in nav is text-only; this is the published metric custom trigger templates and companion step/lifecycle tracks read, space-derived so a density re-theme moves it with the paddings and font sizes that already scale.

Version 22.6.0 - 7/28/26, 12:00 AM

added: WAI-ARIA tablist semantics on the step rail: the rail is role="tablist" with aria-orientation, each trigger is role="tab" with aria-selected / aria-current="step" / aria-disabled, and each step content is a role="tabpanel" wired to its tab through stable generated ids.

added: Keyboard navigation on the rail with a roving tabindex (single Tab stop): Arrow keys move between enabled tabs (skipping disabled ones, wrapping), Home/End jump to the first/last enabled tab, and Enter/Space activates the focused step under the same permission model as clicking.

added: New railLabel input: accessible name of the step rail tablist (default 'Steps').

fixed: Default rail triggers now declare type="button", so a stepper rendered inside a <form> no longer submits it when a step trigger is clicked.

Version 22.5.1 - 7/26/26, 12:00 AM

fixed: StepTriggerDirective selector used a descendant combinator and never instantiated; it now matches either attribute and captures its TemplateRef (groundwork — the stepper does not render custom triggers yet).

changed: Declared the real ng-hub-ui-utils peer range (>=22.7.0); the previous >=1.2.0 floor allowed installs that fail at runtime.

Version 21.2.0 - 3/19/26, 12:00 AM

added: StepperAnimationDirection enum exported for typed animation direction values.

added: Step indexes are now automatically assigned by StepperComponent via a reactive effect — no manual [index] binding required.

changed: StepComponent.index is now an internal writable signal. Remove all [index]="N" bindings from hub-step templates.

changed: StepComponent.disabled simplified to a direct signal input (input(false)), removing the getter/setter and disabled$ backing signal.

changed: StepperComponent.currentIndex is now a writable signal — call as currentIndex() instead of the previous getter.

changed: Renamed internal signals: removed $ suffix from currentIndex, contentAnimating, animationDirection.

removed: StepComponent.disabled$ backing signal removed. Use the disabled signal input directly.

removed: [index] template binding removed from StepComponent — managed internally.

Version 21.1.0 - 3/18/26, 12:00 AM

added: Angular 21 support with Signals-based architecture.

added: contentChild and contentChildren for step and directive discovery.

changed: All components and directives converted to standalone.

fixed: Fixed step indices and validation during dynamic step additions.