@frxjs/ngx-timeline

中文文档
22.0.1发布于 2026/06/23MITTypeScriptES Module近 30 天下载 9066

The main goal of this angular library is to give you the possibility to integrate a timeline in your app.
Version 22.0.0 is compatible with angular 22.
Go here and discover all possible

原始使用文档
文档目录10 节
  1. Installation
  2. Examples of Usage
  3. Configuration
  4. Input
  5. Output
  6. Types and Enums
  7. Custom Theme supported
  8. Examples with contexts of custom templates
  9. How to contribute
  10. How to deploy new version (for maintainers only)

NgxTimeline check-code-coverage

The main goal of this angular library is to give you the possibility to integrate a timeline in your app.
Version 22.0.0 is compatible with angular 22.
Go here and discover all possible configurations for the timeline

image

Fig.1 - Preview of Timeline example configuration page



Installation

Running the following command to install the library

npm install @frxjs/ngx-timeline

Examples of Usage

After installing the library and including NgxTimelineModule in your imports module you could add one of following examples to your template in order to display your timeline

<ngx-timeline [events]="events"></ngx-timeline>
<ngx-timeline [events]="events" [langCode]="'it'"></ngx-timeline>
<ngx-timeline [events]="events" [langCode]="'it'" [enableAnimation]="false"></ngx-timeline>

Configuration

Input

Input nameExplanationMandatoryType/Supported ValuesDefault value
eventslist of events to be displayedyesNgxTimelineEventno default
langCodelanguage code use to format datesno
  • 'de' (German)
  • 'en' (English)
  • 'es' (Spanish)
  • 'fr' (French)
  • 'it' (Italian)
  • 'nb' (Norwegian)
  • 'pl' (Polish)
  • 'pt' (Portuguese)
  • 'ru' (Russian)
  • 'sl' (Slovenian)
  • 'tr' (Turkish)
'en'
enableAnimationBoolean used to enable or disable the animationsnobooleantrue
reverseOrderBoolean used to reverse sort order (default older first)nobooleanfalse
virtualScrollBoolean used to enable or disable the virtual scrollnobooleanfalse
virtualScrollItemSizeNumber of pixels of a single item used for virtual scrollnonumber100
virtualScrollMaxBufferPxNumber of max pixels the buffer for the virtual scroll hasnonumber200
virtualScrollMinBufferPxMinimum amount of the buffer rendered beyond the viewportnonumber100
groupEventLogic to be applied in order to group eventsnoenum NgxTimelineEventGroupNgxTimelineEventGroup.MONTH_YEAR
orientationOrientation of the timelinenoenum NgxTimelineOrientationNgxTimelineOrientation.VERTICAL
changeSideLogic to be applied in order to put events on LEFT or RIGHTnoenum NgxTimelineEventChangeSideNgxTimelineEventChangeSide.ON_DIFFERENT_DAY_IN_GROUP
periodCustomTemplateCustom Template displayed before a group of eventsnoTemplateRef<unknown>no default
eventCustomTemplateCustom Template displayed to show a single eventnoTemplateRef<unknown>no default
centerIconCustomTemplateCustom Template displayed to show an separator iconnoTemplateRef<unknown>no default
dateInstantCustomTemplateCustom Template displayed to show the side datenoTemplateRef<unknown>no default
innerEventCustomTemplateCustom Template displayed to show the inner eventnoTemplateRef<unknown>no default
eventDescriptionCustomTemplateCustom Template displayed to show the descriptionnoTemplateRef<unknown>no default

Output

Output nameExplanationMandatoryType/Supported ValuesDefault value
clickEmitterOutput click event emitternoOutputEmitterRef<NgxTimelineItem>no default

Types and Enums

interface NgxTimelineEvent {
  timestamp: Date;
  title?: string;
  description?: string;
  id?: any;
  itemPosition?: NgxTimelineItemPosition;
}
enum NgxTimelineEventGroup {
  YEAR = 'YEAR',
  MONTH_YEAR = 'MONTH_YEAR',
  DAY_MONTH_YEAR = 'DAY_MONTH_YEAR'
}
export enum NgxTimelineOrientation {
  HORIZONTAL = 'HORIZONTAL',
  VERTICAL = 'VERTICAL',
}
enum NgxTimelineEventChangeSide {
  ALL = 'ALL',
  ALL_IN_GROUP = 'ALL_IN_GROUP',
  ON_DIFFERENT_DAY_IN_GROUP = 'ON_DIFFERENT_DAY_IN_GROUP',
  ON_DIFFERENT_HMS_IN_GROUP = 'ON_DIFFERENT_HMS_IN_GROUP',
  ON_DIFFERENT_MONTH_IN_GROUP = 'ON_DIFFERENT_MONTH_IN_GROUP'
}

Custom Theme supported

This is an example of custom-theme that can be applied for instance via an ng-class directive to the container of the library. In this way you are redefine some variables that are defined and used inside the library and it is easier to override some properties

.custom-theme {
    --ngx-timeline-icon: black;
    --ngx-timeline-period-inner-container: black;
    --ngx-timeline-line-background: black;
}

Examples with contexts of custom templates

  <ng-template #periodCustomTemplate let-period=period let-index=index let-event=event>
    <div [ngClass]="{'transparent first-line': !index}" class="line"></div>
    <div class="period-container">
      <p>
        {{index}} - {{period | json}}
      </p>
    </div>
    <div class="line"></div>
  </ng-template>
  <ng-template #centerIconCustomTemplate let-index=index let-event=event>
    <div class="icon-container">
      <img src="assets/image.png">
    </div>
  </ng-template>
  <ng-template #innerEventCustomTemplate let-event=event>
    <div class="event" (click)="handleClick(event)">
      {{event | json}}
    </div>
  </ng-template>
  <ng-template #eventDescriptionCustomTemplate let-event=event>
    <p class="event-info-description">{{event?.eventInfo?.description}}</p>
  </ng-template>
  <ng-template #eventCustomTemplate let-event=event let-colSidePosition=colSidePosition>
    <div class="event" (click)="handleClick(event)">
      {{event | json}}
    </div>
  </ng-template>
  <ng-template #dateInstantCustomTemplate let-item=item>
    <span>
      {{item | json}}
    </span>
  </ng-template>



How to contribute

First of all, in order to track everything, open an issue describing the problem or a missing functionality you would like to add to the lib.

To start the contribution:

  • npm run watch-lib (you are building the lib with --watch options)
  • npm run start-dev (you are linking the lib and starting the demo app )

Every time you will change the code in your lib, any update will trigger the re-load of the app. When your code will be ready, create a Pull Request and put the link in a comment under the issue you opened before. Now is time to enjoy and start to code.

Thanks in advance for your contribution

How to deploy new version (for maintainers only)

After testing the fix or the new feature with 100% test coverage:

  • npm run lint:fix
  • npm run prepare-github-pages
  • npm run new-version patch
  • git push --tags
  • git push
  • npm run publish

版本与发布记录

@frxjs/ngx-timeline 共发布 66 个版本,首次发布于 2021/04/16;过去 12 个月发布了 3 个版本。

版本发布日期距今
22.0.1latest2026/06/234 个月前
21.0.22025/12/0511 个月前
21.0.12025/12/0311 个月前
20.0.82025/06/271.4 年前
20.0.72025/06/271.4 年前
20.0.62025/06/271.4 年前

关于 @frxjs/ngx-timeline 的常见问题

@frxjs/ngx-timeline 是什么?

The main goal of this angular library is to give you the possibility to integrate a timeline in your app. Version 22.0.0 is compatible with angular 22. Go here and discover all possible

如何安装 @frxjs/ngx-timeline?

在项目目录运行 npm install @frxjs/ngx-timeline,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/cdk(^22.0.1)、@angular/common(^22.0.1)、@angular/core(^22.0.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@frxjs/ngx-timeline 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@frxjs/ngx-timeline 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@frxjs/ngx-timeline 可以商用吗?

@frxjs/ngx-timeline 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@frxjs/ngx-timeline 的下载量有多少?

根据 npm 官方下载统计,@frxjs/ngx-timeline 在 2026/10/16 – 2026/11/14 这 30 天内被下载 9,066 次,日均约 302 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@frxjs/ngx-timeline 还在维护吗?

最新版本 22.0.1 发布于 2026/06/23(4 个月前);至今共发布 66 个版本,其中过去 12 个月发布了 3 个;首次发布于 2021/04/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。