23.0.0 • Published 2 years ago
@logo-elements/virtual-list v23.0.0
@logo-elements/virtual-list
A web component for rendering a long list of items without sacrificing performance.
<logo-elements-virtual-list></logo-elements-virtual-list>
<script>
const list = document.querySelector('logo-elements-virtual-list');
list.items = items; // An array of data items
list.renderer = (root, list, { item, index }) => {
root.textContent = `#${index}: ${item.name}`;
};
</script>
Installation
Install the component:
npm i @logo-elements/virtual-list -s
Once installed, import the component in your application:
import '@logo-elements/virtual-list';