This library is part of the Aurelia platform and contains a plugin that provides a virtualized repeater and other virtualization services. This plugin enables "virtualization" of list through a new virtual-repeat.for. When used, the list "virtually" as tens or hundreds of thousands of rows, but the DOM only actually has rows for what is visible. It could be only tens of items. This allows rendering of massive lists of data with amazing performance. It works like repeat.for, it just creates a scrolling area and manages the list using UI virtualization techniques.
To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, please join our community on Gitter. If you would like to have deeper insight into our development process, please install the ZenHub Chrome or Firefox Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting the framework board.
Install via JSPM
jspm install aurelia-ui-virtualizationLoad the plugin
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-ui-virtualization'); // Add this line to load the plugin
aurelia.start().then(a => a.setRoot());
}Simply bind an array to virtual-repeat like you would with the standard repeat. The repeated rows need to have equal height throughout the list, and one items per row.
<template>
<div virtual-repeat.for="item of items">
${$index} ${item}
</div>
</template><template>
<ul>
<li virtual-repeat.for="item of items">
${$index} ${item}
</li>
</ul>
</template><template>
<table>
<tr virtual-repeat.for="item of items">
<td>${$index}</td>
<td>${item}</td>
</tr>
</table>
</template>export class MyVirtualList {
items = ['Foo', 'Bar', 'Baz'];
}With a surrounding fixed height container with overflow scroll. Note that overflow: scroll styling needs to be inline on the elemenet.
<template>
<div style="overflow: scroll; height: 90vh">
<div virtual-repeat.for="item of items">
${$index} ${item}
</div>
</div>
</template>If you are running the plugin in the skeleton-naviagion project, make sure to remove overflow-x: hidden; and overflow-y: auto; from .page-host in styles.css.
This library can be used in the browser only.
To build the code, follow these steps.
- Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
- From the project folder, execute the following command:
npm install- Ensure that Gulp is installed. If you need to install it, use the following command:
npm install -g gulp- To build the code, you can now run:
gulp build-
You will find the compiled code in the
distfolder, available in three module formats: AMD, CommonJS and ES6. -
See
gulpfile.jsfor other tasks related to generating the docs and linting.
To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:
- Ensure that the Karma CLI is installed. If you need to install it, use the following command:
npm install -g karma-cli- Ensure that jspm is installed. If you need to install it, use the following commnand:
npm install -g jspm- Install the client-side dependencies with jspm:
jspm install- You can now run the tests with this command:
karma start