npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@avine/ng-timeline

v16.0.0

Published

Angular component that displays a list of events in chronological order.

Downloads

6

Readme

Timeline

Angular component that displays a list of events in chronological order.

Demo

Check out demo here.

Usage

Component

import { Component } from '@angular/core';
import { TIMELINE_DIRECTIVES, provideTimelineBreakpoint } from '@avine/ng-timeline';

@Component({
  selector: 'app-timeline-demo',
  standalone: true,
  imports: [TIMELINE_DIRECTIVES],
  providers: [provideTimelineBreakpoint('1280px')], // This is optional
  templateUrl: './timeline.component.html',
})
export class TimelineDemoComponent {
  items = ['Step 1', 'Step 2', 'Step 3'];
}

Template

<!-- Using items input -->
<timeline-container [items]="items" />

<!-- Using timeline-item components  -->
<timeline-container>
  <timeline-item>Step 1</timeline-item>

  <timeline-item>Step 2</timeline-item>

  <timeline-item>
    <ng-template timelineIcon>
      <!-- your SVG icon comes here -->
    </ng-template>

    Step 3
  </timeline-item>
</timeline-container>

API

The different sizes should be entered as numbers (you should not specify units such as em or rem).

These sizes will be treated as em relative to the font-size of the root element of the timeline.

| Input | Type | Default | Description | | ------------------- | ------------------------- | --------- | ---------------------------------------------------------------------- | | items | string[] | [] | The list of items to display. | | pendingFromIndex | NumberInput | undefined | Display the items as pending from the specified index. | | bgColor | string | undefined | undefined | Indicates the background color of the timeline. | | lineSize | TimelineLineSize | {} | Determines the size of the line between bullets. | | bulletPoints | BooleanInput | false | Display bullet points instead of bullet content. | | reverse | BooleanInput | false | Reverse the bullet and content positions. | | vertical | BooleanInput | false | Display timeline in horizontal or vertical direction. | | verticalContentSize | NumberInput | false | Limit the size (width) of the content when the timeline is vertical. | | breakpoint | string | boolean | null | false | Switch between vertical and horizontal timeline based on a breakpoint. |

TimelineLineSize

Determines the size of the line between bullets.

interface TimelineLineSize {
  horizontal?: number;
  vertical?: number;
}

Breakpoint

Switch between vertical and horizontal timeline based on a breakpoint.

If breakpoint is set to true then the default value is used (1024px).

You can provide a different default value using the provideTimelineBreakpoint function:

import { provideTimelineBreakpoint } from '@avine/ng-timeline';

@Component({
  providers: [provideTimelineBreakpoint('1280px')],
})
export class TimelineDemoComponent {}

Or by providing the TIMELINE_BREAKPOINT injection token:

import { TIMELINE_BREAKPOINT } from '@avine/ng-timeline';

@Component({
  providers: [{ provide: TIMELINE_BREAKPOINT, useValue: '1280px' }],
})
export class TimelineDemoComponent {}

Sass customization

You can fully customize the Timeline CSS using Sass.

Below the list of Sass variables:

@use 'node_modules/@avine/ng-timeline/src/lib/scss/timeline.scss' with (
  $timeline-background-color: #fff,

  $timeline-line-thickness: 3px,
  $timeline-line-color: #ced4da,

  $timeline-line-size-horizontal: 10,
  $timeline-line-size-vertical: 2,

  $timeline-bullet-font-size: 1.5,
  $timeline-bullet-outline-size: 0.5,
  $timeline-bullet-border-size: 2px,
  $timeline-bullet-size: 3,

  $timeline-bullet-border-color: #6ea8fe,
  $timeline-bullet-background-color: #0d6efd,
  $timeline-bullet-color: #fff,

  $timeline-pending-bullet-scale: 0.875,
  $timeline-pending-bullet-border-color: #dee2e6,
  $timeline-pending-bullet-background-color: #adb5bd,
  $timeline-pending-bullet-color: #e9ecef,
  $timeline-pending-content-color: #999,

  $timeline-vertical-content-size: auto
);

License

MIT