virtualize-js
v1.0.3
Published
Tiny virtual scrolling library with dynamic height elements support.
Downloads
8
Maintainers
Readme
virtualize-js
virtualize-js
is a tiny and simple virtual scrolling library.
Features:
- Variable Element Height Support: Handles items of different heights;
- Dependency-Free: 0 external dependencies;
- Simple API: Only one function —
render
.
Installation
Install via npm:
npm install virtualize-js
Usage
Basic example:
import { render } from 'virtualize-js';
//renders items in itemsContainer
render(items, itemsContainer);
API
render(items, itemsContainer)
Renders the visible items and buffers based on scroll position.
items
: Array ofHTMLElement
.itemsContainer
:HTMLElement
(for example div) in which items should be rendered.
License
MIT License.