{"id":17756953,"url":"https://github.com/thisissoon/angular-scrollspy","last_synced_at":"2025-07-19T05:07:13.422Z","repository":{"id":57141288,"uuid":"101995294","full_name":"thisissoon/angular-scrollspy","owner":"thisissoon","description":"A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport","archived":false,"fork":false,"pushed_at":"2019-02-05T12:50:00.000Z","size":665,"stargazers_count":35,"open_issues_count":8,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-04T11:06:04.973Z","etag":null,"topics":["angular","component","directive","directives","navbar","navigation","navigationbar","ngx","ngx-library","ngx-scroll-spy","ngx-scrollspy","scrolling","scrollspy"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thisissoon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-31T11:48:42.000Z","updated_at":"2023-08-26T05:04:35.000Z","dependencies_parsed_at":"2022-09-05T18:31:34.267Z","dependency_job_id":null,"html_url":"https://github.com/thisissoon/angular-scrollspy","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/thisissoon/angular-scrollspy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisissoon%2Fangular-scrollspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisissoon%2Fangular-scrollspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisissoon%2Fangular-scrollspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisissoon%2Fangular-scrollspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thisissoon","download_url":"https://codeload.github.com/thisissoon/angular-scrollspy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisissoon%2Fangular-scrollspy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265892105,"owners_count":23844967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","component","directive","directives","navbar","navigation","navigationbar","ngx","ngx-library","ngx-scroll-spy","ngx-scrollspy","scrolling","scrollspy"],"created_at":"2024-10-26T16:10:51.534Z","updated_at":"2025-07-19T05:07:13.405Z","avatar_url":"https://github.com/thisissoon.png","language":"TypeScript","readme":"# Angular ScrollSpy\n\n[![Build Status][circle-badge]][circle-badge-url]\n[![Coverage Status][coveralls-badge]][coveralls-badge-url]\n[![Commitizen friendly][commitizen-badge]][commitizen]\n[![code style: prettier][prettier-badge]][prettier-badge-url]\n\nA simple lightweight library for [Angular][angular] which automatically updates links to indicate the currently active section in the viewport. Requires [Angular Inviewport][angular-inviewport] to be installed as well.\n\nThis is a simple library for [Angular][angular], implemented in the [Angular Package Format v5.0](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/edit#heading=h.k0mh3o8u5hx).\n\n## Install\n\n`npm i @thisissoon/{angular-scrollspy,angular-inviewport} --save`\n\n`app.module.ts`\n\n```ts\nimport { InViewportModule } from '@thisissoon/angular-inviewport';\nimport { ScrollSpyModule } from '@thisissoon/angular-scrollspy';\n\n@NgModule({\n  imports: [InViewportModule, ScrollSpyModule.forRoot()],\n})\nexport class AppModule {}\n```\n\n## Example\n\nA working example can be found in the [src](https://github.com/thisissoon/angular-scrollspy/tree/master/src) folder.\n\n`app.component.html`\n\n```html\n\u003cul role=\"navigation\" snScrollSpy id=\"foo\"\u003e\n  \u003cli\u003e\u003ca snScrollSpyItem for=\"foo\" href=\"#section1\"\u003eSection 1\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca snScrollSpyItem for=\"foo\" href=\"#section2\"\u003eSection 2\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca snScrollSpyItem for=\"foo\" href=\"#section3\"\u003eSection 3\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca snScrollSpyItem for=\"foo\" href=\"#section4\"\u003eSection 4\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003csn-scroll-spy-section id=\"section1\" for=\"foo\"\u003econtent goes here\u003c/sn-scroll-spy-section\u003e\n\u003csn-scroll-spy-section id=\"section2\" for=\"foo\"\u003econtent goes here\u003c/sn-scroll-spy-section\u003e\n\u003csn-scroll-spy-section id=\"section3\" for=\"foo\"\u003econtent goes here\u003c/sn-scroll-spy-section\u003e\n\u003csn-scroll-spy-section id=\"section4\" for=\"foo\"\u003econtent goes here\u003c/sn-scroll-spy-section\u003e\n```\n\n`app.component.css`\n\n```css\na {\n  color: blue;\n  transition: color 0.2s ease-in-out;\n}\n\na.active {\n  color: darkblue;\n}\n```\n\n## Browser Support\n\nThis library makes use of the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) which requires a [polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill) to work on some browsers.\n\n### Install the polyfill\n\n```bash\nnpm i intersection-observer\n```\n\nOr use yarn\n\n```bash\nyarn add intersection-observer\n```\n\n### Include the polyfill\n\nAdd this somewhere in your `src/polyfills.ts` file\n\n```ts\nimport 'intersection-observer';\n```\n\n## Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n## Build\n\nRun `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.\n\n## Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\n\n## Making Commits\n\nThis repo uses [Commitizen CLI][commitizen] and [Conventional Changelog][conventional-changelog] to create commits and generate changelogs. Instead of running `git commit` run `git cz` and follow the prompts. Changelogs will then be generated when creating new releases by running `npm run release`.\n\n## Making Releases\n\nRun `npm run release` to create a new release. This will use [Standard Version][standard-version] to create a new release. [Standard Version][standard-version] will generate / update the changelog based on commits generated using [Commitizen CLI][commitizen], update the version number following semantic versioning rules and then commit and tag the commit for the release. Simply run `git push --follow-tags origin master`.\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n\n[circle-badge]: https://https://circleci.com/gh/thisissoon/angular-scrollspy.svg?style=sheild\n[circle-badge-url]: https://https://circleci.com/gh/thisissoon/angular-scrollspy\n[coveralls-badge]: https://coveralls.io/repos/github/thisissoon/angular-scrollspy/badge.svg?branch=master\n[coveralls-badge-url]: https://coveralls.io/github/thisissoon/angular-scrollspy?branch=master\n[angular]: https://angular.io/\n[angular-inviewport]: https://github.com/thisissoon/angular-inviewport/\n[prettier-badge]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=shield\n[prettier-badge-url]: https://github.com/prettier/prettier\n[conventional-changelog]: https://github.com/conventional-changelog/conventional-changelog\n[commitizen]: http://commitizen.github.io/cz-cli/\n[commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[standard-version]: https://github.com/conventional-changelog/standard-version\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisissoon%2Fangular-scrollspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisissoon%2Fangular-scrollspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisissoon%2Fangular-scrollspy/lists"}