Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 805 Bytes

File metadata and controls

42 lines (26 loc) · 805 Bytes

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.

Live demo 🚀

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 of HTMLElement.
  • itemsContainer: HTMLElement (for example div) in which items should be rendered.

License

MIT License.