# scroller

```ts
import { ScrollerModule } from '@anguless/angulux/scroller';
```

## Scroller

`agl-scroller, agl-virtualscroller, agl-virtual-scroller, agl-virtualScroller` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

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

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `hostName` | `` | _not documented_ |  |
| `id` | `string \| undefined` | _not documented_ | Unique identifier of the element. |
| `style` | `any` | _not documented_ | Inline style of the component. |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the element. |
| `tabindex` | `` | _not documented_ | Index of the element in tabbing order. |
| `items` | `any[] \| undefined \| null` | _not documented_ | An array of objects to display. |
| `itemSize` | `number[] \| number` | _not documented_ | The height/width of item according to orientation. |
| `scrollHeight` | `string \| undefined` | _not documented_ | Height of the scroll viewport. |
| `scrollWidth` | `string \| undefined` | _not documented_ | Width of the scroll viewport. |
| `orientation` | `'vertical' \| 'horizontal' \| 'both'` | _not documented_ | The orientation of scrollbar. |
| `step` | `number` | _not documented_ | Used to specify how many items to load in each load method in lazy mode. |
| `delay` | `` | _not documented_ | Delay in scroll before new data is loaded. |
| `resizeDelay` | `` | _not documented_ | Delay after window's resize finishes. |
| `appendOnly` | `boolean` | _not documented_ | Used to append each loaded item to top without removing any items from the DOM. Using very large data may cause the browser to crash. |
| `inline` | `` | _not documented_ | Specifies whether the scroller should be displayed inline or not. |
| `lazy` | `` | _not documented_ | Defines if data is loaded and interacted with in lazy manner. |
| `disabled` | `` | _not documented_ | If disabled, the scroller feature is eliminated and the content is displayed directly. |
| `loaderDisabled` | `` | _not documented_ | Used to implement a custom loader instead of using the loader feature in the scroller. |
| `columns` | `any[] \| undefined \| null` | _not documented_ | Columns to display. |
| `showSpacer` | `` | _not documented_ | Used to implement a custom spacer instead of using the spacer feature in the scroller. |
| `showLoader` | `` | _not documented_ | Defines whether to show loader. |
| `numToleratedItems` | `` | _not documented_ | Determines 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. |
| `loading` | `boolean \| undefined` | _not documented_ | Defines whether the data is loaded. |
| `autoSize` | `boolean` | _not documented_ | Defines whether to dynamically change the height or width of scrollable container. |
| `trackBy` | `Function` | _not documented_ | Function to optimize the dom operations by delegating to ngForTrackBy, default algoritm checks for object identity. |
| `options` | `ScrollerOptions \| undefined` | _not documented_ | Defines whether to use the scroller feature. The properties of scroller component can be used like an object in it. |

| Output | Type | Description |
| --- | --- | --- |
| `onLazyLoad` | `EventEmitter<ScrollerLazyLoadEvent>` | Callback to invoke in lazy mode to load new data. |
| `onScroll` | `EventEmitter<ScrollerScrollEvent>` | Callback to invoke when scroll position changes. |
| `onScrollIndexChange` | `EventEmitter<ScrollerScrollIndexChangeEvent>` | Callback to invoke when scroll position and item's range in view changes. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #content>` | `contentTemplate` | Content template of the component. |
| `<ng-template #item>` | `itemTemplate` | Item template of the component. |
| `<ng-template #loader>` | `loaderTemplate` | Loader template of the component. |
| `<ng-template #loadericon>` | `loaderIconTemplate` | Loader icon template of the component. |
