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

step-journey

v1.0.13

Published

A customizable Angular library for visualizing step-by-step journeys.

Downloads

515

Readme

Step Journey Library

step-journey is an Angular library designed to create customizable and dynamic step-by-step progress bars. This library allows you to define a sequence of steps with customizable colors, statuses, and labels, making it ideal for visualizing multi-step workflows.

Features

  • Dynamic Step Management: Easily update the list of steps and display their statuses as completed, current, or pending.
  • Customizable Styling: Define specific colors for each step or set defaults for completed, current, and pending statuses.
  • Flexible Divider Width: Customize the width of dividers between steps for enhanced visual control.
  • Modular Components: Library is structured with separate components for each step, divider, and overall journey, enabling clear customization and maintenance.

Usage

Importing the Module

In your Angular application, import StepJourneyModule from step-journey in the main application module:

import { StepJourneyModule } from 'step-journey';

@NgModule({
  imports: [StepJourneyModule],
  // other imports
})
export class AppModule {}

Adding StepJourneyComponent to Your Template

The main component, lib-step-journey, accepts an array of steps and other optional customization inputs.

Example usage in a template:

<lib-step-journey
  [steps]="[
    { label: 'Step 1', status: 'completed', color: '#4CAF50' },
    { label: 'Step 2', status: 'completed' },
    { label: 'Step 3', status: 'current', color: '#FF9800', tooltipText: 'Step 3 tooltip text' },
    { label: 'Step 4', status: 'pending' }
  ]"
  dividerWidth="80px"
  maxWidth="900px"
  fontSize="1.2em"
></lib-step-journey>

Properties

The StepJourneyComponent supports the following properties:

  • steps (Step[]): An array of steps defining each step’s label, subLabel, status, and optional color.
    • label (string): Main label for the step.
    • subLabel (string, optional): Additional label below the main label.
    • status ('completed' | 'current' | 'pending'): Defines the step's state.
    • color (string, optional): Custom color for this specific step.
    • tooltipText (string, optional): Custom description for this specific step, appears as an html title attribute.
  • dividerWidth (string, optional): Width of dividers between steps. Default is 4px.
  • maxWidth (string, optional): Max width of complete component. Default is 600px.
  • fontSize (string, optional): Font size of label. Default is 0.7em.

Updating Steps Dynamically

To dynamically update the steps, use an Angular binding and a function in your component class. For example:

In app.component.ts

export class AppComponent {
  steps = [
    { label: 'Step 1', status: 'completed', color: '#4CAF50' },
    { label: 'Step 2', status: 'completed' },
    { label: 'Step 3', status: 'current', color: '#FF9800', tooltipText: 'Step 3 tooltip text' },
    { label: 'Step 4', status: 'pending' }
  ];

  updateSteps() {
    this.steps = [
      { label: 'Step 1', status: 'completed', color: '#4CAF50' },
      { label: 'Step 2', status: 'completed' },
      { label: 'Step 3', status: 'completed', tooltipText: 'Step 3 tooltip text' },
      { label: 'Step 4', status: 'current', color: '#FF9800' },
      { label: 'Step 5', status: 'pending' }
    ];
  }
}

In app.component.html

<button (click)="updateSteps()">Update Steps</button>
<lib-step-journey [steps]="steps" dividerWidth="80px" maxWidth="900px" fontSize="1.2em"></lib-step-journey>

Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Submit a pull request for any bug fixes or enhancements.

License

This project is licensed under the MIT License. See the LICENSE file for more details.