@ciri/ngx-sticky

An angular sticky component.

Usage no npm install needed!

<script type="module">
  import ciriNgxSticky from 'https://cdn.skypack.dev/@ciri/ngx-sticky';
</script>

README

NgxSticky

An angular sticky component.

development environment: angular 8.2.14

travis

👉 Demo

Install

npm i @ciri/ngx-sticky

Quick Start

Add it to your module:

import { StickyModule } from '@ciri/ngx-sticky'

@NgModule({
  // ...
  imports: [
    // ...
    StickyModule
  ],
})

Add to view:

<ngx-sticky [offsetTop]="0">hello world</ngx-sticky>

Inputs

Name Type Default Description
offsetTop number 0 Offset top
zIndex number 1 Equivalent to css z-index

Outputs

Event Description Return value
change Triggered when state change state