README.md

July 27, 2026 ยท View on GitHub

NgxFixedFooter

npm version Package License NPM Downloads Snyk codecov stars forks HitCount

Angular directive that adds fixed footer without overlap

โœ“ Angular 22 compatible

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

  • Lightweight
  • No dependencies!
  • Directive way

๐Ÿ› ๏ธ Install

  1. Use Bun to install the package
bun 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
         ]
      })
    

๐Ÿš€ 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
[containerSelector]stringvalue taken from root optionsCss selector used for additional padding/margin
[cssAttribute]'margin' or 'padding'value taken from root optionsCss attribute used on 'containerSelector'

๐Ÿ”ง Compatibility

Angularngx-fixed-footerInstall
>= 225.xbun add ngx-fixed-footer
>= 204.xbun add ngx-fixed-footer@4
>= 183.xbun add ngx-fixed-footer@3
>= 142.xbun add ngx-fixed-footer@2
>= 121.xbun add ngx-fixed-footer@1
>= 5 < 130.xbun add ngx-fixed-footer@0

๐Ÿ“ฆ Dependencies

None

๐Ÿชช License

Copyright ยฉ 2021 - 2026 Dominik Hladik

All contents are licensed under the MIT license.