horizontal-timeline

October 22, 2017 ยท View on GitHub

Horizontal Timeline Component on Angular2 (original component: https://codyhouse.co/demo/horizontal-timeline/index.html)

Usage

  1. Clone repository.
  2. Copy horizontal-timeline to your components folder.
  3. Move cd-arrow.svg to your assets folder.
  4. Modify horizontal-timeline.component.css: change url to your assets folder in line background: url(assets/images/cd-arrow.svg) no-repeat 0 0; (see https://github.com/angular/angular/issues/6637).
  5. Use component on your page: <horizontal-timeline [timelineElements]="timeline" [showContent]="true"></horizontal-timeline>.

Properties

NameTypeDescriptionDefault value
eventsMinDistancenumberMinimal distance between elements in px80
timelineElementsTimelineElementTimeline elementsnone
dateFormatstringDate format string'dd.MM.yyyy'
disabledbooleanIf true, only left and right buttons are clickablefalse
showContentbooleanUse false to hide content, true to show contentfalse
timelineWrapperWidthnumberWidth of timeline wrapper in px720

TimelineElement interface

NameTypeDescription
dateDateEvent date
titlestringElement content title
selectedbooleanIs element selected
contentstringElement content