2.0.1 • Published 3 months ago

ngx-fixed-footer v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

npm version Package License NPM Downloads Snyk codecov stars forks HitCount

Angular directive that adds fixed footer without overlap

Angular 17 compatible

Here's the demo or stackblitz live preview or codesandbox live preview

  • Lightweight
  • No dependencies!
  • Directive way

Install

  1. Use yarn (or npm) to install the package
yarn add ngx-fixed-footer
  1. Add NgxFixedFooterModule into your module imports

    2.1. import providers (optional)

      import { provideFixedFooter } from 'ngx-fixed-footer';
    
      export const appConfig: ApplicationConfig = {
        providers: [
          // ...
          provideFixedFooter({
            containerSelector: '[data-something]',
            cssAttribute: 'margin'
          })
        ]
      };
    
      // or
    
      import { provideFixedFooter } from 'ngx-fixed-footer';
    
      @NgModule({
       // ...
       imports: [
         // ...
         provideFixedFooter({
           containerSelector: '[data-something]',
           cssAttribute: 'margin'
         })
       ]
      })

    2.2 import directive

      import { NgxFixedFooterDirective } from 'ngx-fixed-footer';
    
      @Component({
         standalone: true,
         imports: [
           // ...
           NgxFixedFooterDirective
         ]
      })
    
      // or
    
      import { NgxFixedFooterDirective } from 'ngx-fixed-footer';
    
      @NgModule({
         // ...
         imports: [
           // ...
           NgxFixedFooterDirective
         ]
      })

Compatibility

Angularngx-fixed-footerInstall
>= 142.xyarn add ngx-fixed-footer
>= 121.xyarn add ngx-fixed-footer@1
>= 5 < 130.xyarn add ngx-fixed-footer@0

Quick start

Example code

<div role="main">...some content here</div>
<div ngxFixedFooter [containerSelector]="[role='main']" [cssAttribute]="'padding'">... some content here</div>

Result

<div role="main" style="padding-bottom: {{ /* dynamic height of footer */ }}">...some content here</div>
<div ngxFixedFooter [containerSelector]="[role='main']" [cssAttribute]="'padding'">... some content here</div>

Options

Root options

Module can be configured globally.

OptionTypeDefaultDescription
containerSelectorstring'role="main"'Css selector used for additional padding/margin
cssAttribute'margin' or 'padding''padding'Css attribute used on 'containerSelector'

Directive

Each directive can override global options.

OptionTypeDefaultDescription
containerSelectorstringvalue taken from root optionsCss selector used for additional padding/margin
cssAttribute'margin' or 'padding'value taken from root optionsCss attribute used on 'containerSelector'

Dependencies

None

License

Copyright © 2021 - 2024 Dominik Hladik

All contents are licensed under the MIT license.

2.0.1

3 months ago

2.0.0

4 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago