angular-overflow-indicator
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

angular-overflow-indicator

This library includes a simple and performant component that displays a given button if the content of the component overflows.

Features

Button that displays/hides accordingly

Overflow indicator example

Observe the scroll state

Overflow indicator example

Basic Usage

Step 1: Install the package

yarn add angular-overflow-indicator

or

npm install angular-overflow-indicator

Step 2: Install the package

import { ScrollViewWithIndicatorComponent } from 'angular-overflow-indicator';

Step 3: Create a container with a maximum/fixed size

<div [style]="{ height: '300px', width: '500px' }">
 // ...
</div>

Step 4: Add a template that includes the indicator-button

<div [style]="{ height: '300px', width: '500px' }">
  <ng-template #customButton>
    <button (click)="view.scrollToBottom()">There is more below <i>👇</i></button>
  </ng-template>
  
  // ...
</div>

Step 5: Add the overflow-indicator-component with a list larger than the outer container and pass the template reference of the indicator-button

<div [style]="{ height: '300px', width: '500px' }">
  <ng-template #customButton>
    <button (click)="view.scrollToBottom()">There is more below <i>👇</i></button>
  </ng-template>

  <ng-scroll-view-with-indicator #view [indicatorButton]="customButton">
    <ul>
      <li *ngFor="let item of items()">List item {{ item }}</li>
    </ul>
  </ng-scroll-view-with-indicator>
</div>

Package Sidebar

Install

npm i angular-overflow-indicator

Weekly Downloads

2

Version

0.3.3

License

MIT

Unpacked Size

37.9 kB

Total Files

15

Last publish

Collaborators

  • hansi_reit