Skip to content
angulux
@anguless/angulux/scroller

scroller

1 declarations2 demos
import
import { ScrollerModule } from '@anguless/angulux/scroller';

Basic

Ten thousand rows, of which only the visible ones are in the DOM.

<agl-scroller [items]="items" [itemSize]="40" scrollHeight="240px" [style]="{ width: '18rem', border: '1px solid var(--border, #e2e8f0)', borderRadius: '10px' }">    <ng-template #item let-item let-options="options">        <div style="height: 40px; display: flex; align-items: center; padding: 0 0.75rem">{{ item }}</div>    </ng-template></agl-scroller>

Horizontal

Orientation switches the axis being virtualised.

<agl-scroller [items]="items" [itemSize]="80" orientation="horizontal" [style]="{ width: '20rem', height: '4rem', border: '1px solid var(--border, #e2e8f0)', borderRadius: '10px' }">    <ng-template #item let-item>        <div style="width: 80px; height: 100%; display: flex; align-items: center; justify-content: center">{{ item }}</div>    </ng-template></agl-scroller>

API

Generated from the committed corpus, which check:corpus holds to the built library.

Scroller

componentagl-scroller, agl-virtualscroller, agl-virtual-scroller, agl-virtualScroller

Scroller is a performance-approach to handle huge data efficiently.

InputTypeDefaultDescription
hostNamenot documented
idstring | undefinednot documentedUnique identifier of the element.
styleanynot documentedInline style of the component.
styleClassstring | undefinednot documentedStyle class of the element.
tabindexnot documentedIndex of the element in tabbing order.
itemsany[] | undefined | nullnot documentedAn array of objects to display.
itemSizenumber[] | numbernot documentedThe height/width of item according to orientation.
scrollHeightstring | undefinednot documentedHeight of the scroll viewport.
scrollWidthstring | undefinednot documentedWidth of the scroll viewport.
orientation'vertical' | 'horizontal' | 'both'not documentedThe orientation of scrollbar.
stepnumbernot documentedUsed to specify how many items to load in each load method in lazy mode.
delaynot documentedDelay in scroll before new data is loaded.
resizeDelaynot documentedDelay after window's resize finishes.
appendOnlybooleannot documentedUsed to append each loaded item to top without removing any items from the DOM. Using very large data may cause the browser to crash.
inlinenot documentedSpecifies whether the scroller should be displayed inline or not.
lazynot documentedDefines if data is loaded and interacted with in lazy manner.
disablednot documentedIf disabled, the scroller feature is eliminated and the content is displayed directly.
loaderDisablednot documentedUsed to implement a custom loader instead of using the loader feature in the scroller.
columnsany[] | undefined | nullnot documentedColumns to display.
showSpacernot documentedUsed to implement a custom spacer instead of using the spacer feature in the scroller.
showLoadernot documentedDefines whether to show loader.
numToleratedItemsnot documentedDetermines how many additional elements to add to the DOM outside of the view. According to the scrolls made up and down, extra items are added in a certain algorithm in the form of multiples of this number. Default value is half the number of items shown in the view.
loadingboolean | undefinednot documentedDefines whether the data is loaded.
autoSizebooleannot documentedDefines whether to dynamically change the height or width of scrollable container.
trackByFunctionnot documentedFunction to optimize the dom operations by delegating to ngForTrackBy, default algoritm checks for object identity.
optionsScrollerOptions | undefinednot documentedDefines whether to use the scroller feature. The properties of scroller component can be used like an object in it.
OutputTypeDescription
onLazyLoadEventEmitter<ScrollerLazyLoadEvent>Callback to invoke in lazy mode to load new data.
onScrollEventEmitter<ScrollerScrollEvent>Callback to invoke when scroll position changes.
onScrollIndexChangeEventEmitter<ScrollerScrollIndexChangeEvent>Callback to invoke when scroll position and item's range in view changes.
Template slotDescription
<ng-template #content>Content template of the component.
<ng-template #item>Item template of the component.
<ng-template #loader>Loader template of the component.
<ng-template #loadericon>Loader icon template of the component.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.