🥪 Virtualized List | Twuni UI
A tiny virtualized list implementation for Preact apps.
Features
- Tiny footprint (~2KB gzipped!)
- No dependencies (BYO Preact/HTM)
- MIT license
- Browser-native ESM friendly (designed specifically to require zero build tools to run)
Installing
npm install --save @twuni/ui-list
Yarn users, you know what to do instead.
Usage
The following examples are written in JSX format, for brevity.
Example: Basic Usage
import List from '@twuni/ui-list';
<List
count={1000000}
renderItem={(index) => <p>Item {index}</p>}
/>
There are only two props:
-
count
(number) - How many items are in the list, total. -
renderItem
(function(number)) - A function that, given the index of the item to render, returns the rendered list item.