/ngx-sticky

Sticky Directive for Angular 2+

Primary LanguageTypeScriptMIT LicenseMIT

@enten/ngx-sticky

NPM Version NPM Dependencies Build Status Coverage Status License: MIT

⚠️ WIP

An Angular directive for making things sticky when the user scrolls (for Angular 2+) with no jQuery Dependency.

Requirements

  • Angular (requires Angular 4.x or higher)
  • Supports all major browsers and IE11 and up (lower versions might not be supported)

Features

  • Stick all the things!
  • Super smooth!
  • Tested in real world projects
  • Support for Angular Universal
  • Prevents page-jumping when switching to sticky mode
  • No jQuery or other dependencies - pure Angular solution
  • Support for boundaries to make elements stop

Installation

with npm:

npm install @enten/ngx-sticky

with yarn:

yarn add @enten/ngx-sticky

Now import the NgxStickyModule in the corresponding Module

import { NgxStickyModule } from '@enten/ngx-sticky';

@NgModule({
  declarations: [
  ],
  imports: [
    NgxStickyModule,
  ],
  providers: [],
})
export class SomeModule { }

Usage

<div ngxSticky>
  I am sticky!
</div>

Thanks to

License

MIT