1.1.2 • Published 2 years ago

ngx-mat-timeline v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

NgxMatTimeline

Timeline component for Angular Material

w3soto

StackBlitz Demo

Screenshot

Features

  • Vertical and Horizontal orientation
  • Left, Center and Right position
  • Reversed direction
  • Support for Google Material Icons (including SVG) and images
  • Custom icon and label directives

Installation

npm -i ngx-mat-timeline

Example

Fro more details see projects/demo application

import { NgxMatTimelineModule } from "ngx-mat-timeline";
...

@NgModule({
  imports: [
    ...,
    NgxMatTimelineModule,
  ],
  ...
})
class AppModule { ... }

Basic template

<ngx-mat-timeline 
  position="center" 
  orientation="horizontal">

  <ngx-mat-timeline-item
    *ngFor="let item of timelineItems"
    [icon]="item.icon"
    [label]="item.label">

    {{ item.content }}
    
  </ngx-mat-timeline-item>

</ngx-mat-timeline>

Custom template

<ngx-mat-timeline 
  position="center" 
  orientation="horizontal">

  <ngx-mat-timeline-item
    *ngFor="let item of timelineItems; let idx = index;">

    <ng-template ngxMatTimelineItemIcon>
      <div class="custom-icon">{{ idx + 1 }}</div>
    </ng-template>

    <ng-template ngxMatTimelineItemLabel>
      <div class="custom-label">{{ item.label }}</div>
    </ng-template>

    <div class="custom-content">
      <img [src]="'./assets/image' + (idx + 1) + '.jpg'"> 
      {{ item.content }}
    </div>
    
  </ngx-mat-timeline-item>

</ngx-mat-timeline>

Components

  • ngx-mat-timeline
@InputTypeAvailable valuesDefault
orientationstringvertical, horizontalvertical
positionstringstart, center, center-alt, endstart
reversebooleanfalse
  • ngx-mat-timeline-item
@InputTypeAvailable valuesDefault
iconstringStandard MatIcon value
svgIconstringStandard MatIcon value (svgIcon)
iconUrlstringImage url
labelstringText

Note: If multiple icons are defined, only first one is displayed (icon or svgIcon or iconUrl).

Directives

Use with ng-template.

  • ngxMatTimelineItemIcon

  • ngxMatTimelineItemLabel

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago