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

ngx-scrollspys

v1.0.4

Published

Plugin to create a smooth and custom scrollspy experience in your application

Downloads

11

Readme

ngx-scrollspys

This is an extension for Angular 2+ applications, for smooth scroll-spy experience

Installation

Install this extension from npm repository using

  - npm i ngx-scrollspys --save

Setting Up

Setup in your angular project by importing, NeatScrollspyModule into your app.module.ts

      import { NeatScrollspyModule } from 'ngx-scrollspys'; 

      ...... 

      @NgModule({
        declarations: [ ... ],
        imports: [
          ....
          NeatScrollspyModule,
        ]
      })

Getting Started

NeatScrollspy can be used real quick and easy, with just two basics.

  1. Set the point in your HTML you want to monitor scroll

     <div [neatScrollSpy]="{ id: 'uniqueID', selector: 'mains'}">
           // Place code you want to spy on scroll here with assigned selector as class
           // Example <h2 class="mains"></h2>
     </div>
              
  2. Set where to display scroll options and responses

     <neat-scrollspy-template [neatScrollspyOptions]="{ id: 'uniqueID' }"></neat-scrollspy-template>

neatScrollSpy (directive)

This is the marker used to tell the extension to listen for elements within its span. The available options for this directive are as follows:

| Option | Description | | ------ | ----------- | | id | This is a unique field used by the extension template to identify its marker. Note: This field must be unique | | selector | This is a class field, used by the extension |

neat-scrollspy-template (template)

This is the template for neat-scrollspy, which display the scroll options. Available directives within this template are:

highlightOptions (directive)

This option is used for editing the highlighting style of the neatScrollSpy extension. Example of usage:

    <neat-scrollspy-template [highlightOptions]="{ type: 'bold' }" [neatScrollspyOptions]="{ id: 'uniqueID' }"></neat-scrollspy-template>

| Option | Description | | ------ | ----------- | | type | Uses this option to indicate the type of highlight you want. Available options are: "bold" and "background-color". Default is "bold" | | highlightColor | This is the color taken by the currently displayed element within view. It is used to indicate which element is currently within view. Default is "blue" | | defaultColor | This is the default color used by all other elements outside the current view. Default is "black" | | highlightTextColor | This is the text color used by all elements within the current view. Default is "white" |

selectionOrder (directive)

This option is used for editing the number of items highlighted on a page. Example of usage:

    <neat-scrollspy-template [selectionOrder]="{ type: 'first' }" [neatScrollspyOptions]="{ id: 'uniqueID' }"></neat-scrollspy-template>

| Option | Description | | ------ | ----------- | | type | This is used to indicate which element(s) within view is highlighted. Available options are; "first" and "all". first - This highlights the first element within vie. all - This highlights all element within view |

alignOption (directive)

This option is used for editing the alignment structure on the page. Example of usage:

    <neat-scrollspy-template [alignOption]="{ type: 'straight' }" [neatScrollspyOptions]="{ id: 'uniqueID' }"></neat-scrollspy-template>

| Option | Description | | ------ | ----------- | | type | This is set alignment for the scrollspy options. The Available options are: "straight", "auto", "manual". straight - This aligns all scrollspy options in a straight line (Default). auto - This aligns the scrollspy options in a tree manner, using regular [h1 - h5]. manual - This aligns the scrollspy options as set by the users. Users can set indentation using the "data-align" attribute. | | topMargin | This accepts an integer as value, indicating the distance from the top of the page to the selected item when clicked. Default 70 |

TODO

  • Unit Test
  • Publish Example Page