# ngx-sticky

> Angular sticky boxes

Latest version **2.0.1** (published 2018-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-sticky
pnpm add ngx-sticky
yarn add ngx-sticky
bun add ngx-sticky
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2018-06-20 |
| First published | 2018-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | barbared |
| Maintainers | barbared93 |
| Keywords | Angular 2+, sticky |

## Links

- npm: https://www.npmjs.com/package/ngx-sticky
- Repository: https://github.com/barbared/ngx-sticky
- Homepage: https://github.com/barbared/ngx-sticky#readme
- Issues: https://github.com/barbared/ngx-sticky/issues
- npm.io page: https://npm.io/package/ngx-sticky

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^5.5.2
- [typescript](https://npm.io/package/typescript.md) ^2.3.4
- [@angular/core](https://npm.io/package/@angular/core.md) ^4.4.6
- [@angular/platform-browser](https://npm.io/package/@angular/platform-browser.md) ^4.4.6

## Recent versions

- 2.0.1 (latest) — 2018-06-20
- 2.0.0 — 2018-06-20
- 1.0.1 — 2018-04-19
- 1.0.0 — 2018-04-19

## README

# ngx-sticky

**Angular sticky boxes**

[![npm](https://img.shields.io/npm/v/ngx-sticky.svg?maxAge=2592000?style=flat-square)](https://www.npmjs.com/package/ngx-sticky)
[![npm](https://img.shields.io/npm/dm/ngx-sticky.svg)](https://www.npmjs.com/package/ngx-sticky)

## Description
Angular attribute directive for the creation of sticky boxes in the web-pages of your applications.
Compatible __Angular4+__.

This directive will have a result similar to the CSS3 property __position: sticky__ but it also allows to set sticky boxes in respect to the bottom baseline of the view.

## Installation

To install this component to an external project, follow the procedure:

1. __npm install ngx-sticky --save__

2. Add __NgxStickyModule__ import to your __@NgModule__ like example below
```ts
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';

    import { NgxStickyModule } from 'ngx-sticky';

    import { MyTestApp } from './my-test-app';

    @NgModule({
        imports: [ 
          BrowserModule,
          NgxStickyModule 
        ],
        declarations: [ MyTestApp ],
        bootstrap:    [ MyTestApp ]
    })
    export class MyTestAppModule {}
```
    
## Usage

Apply the __appSticky__ directive to your HTML tags and use the following attributes to manage its options.

```html
    <div appSticky position="top" margin="50" id="myElement"> </div>
```
    
## Attributes

| Option         | Default        | Type | Description |
| :------------- | :------------- | :---------- | :---------- |
| __position__     | 'top' | string | Position of reference for the sticky.  __top__: the element will stick in respect to the top line. __bottom__: the element will stick in respect to the bottom line. |
| __margin__   | 0 | number | Number of pixel for the element margin in respect of the reference _position_ while it is sticky. |

## Compatibility (tested with)
* Firefox (latest)
* Chrome (latest)
* Edge
* IE10
* Safari

## License
* License: MIT

## Author
* Author: barbared

## Keywords
* sticky
* Angular2+
* typescript

---
_Source: https://npm.io/package/ngx-sticky · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
