All Projects → dwqs → react-virtual-list

dwqs / react-virtual-list

Licence: MIT license
A tiny virtualization list component(gzipped 6KB), supports dynamic height: https://dwqs.github.io/react-virtual-list/

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-virtual-list

vue-virtual-stream
Simple vue-virtualized package for Vue.js
Stars: ✭ 16 (-64.44%)
Mutual labels:  virtualization, virtual
ModernOperatingSystems AndrewTanenbaum
My notes after reading 'Modern Operating Systems' book by Andrew Tanenbaum and Herbert Bos.
Stars: ✭ 71 (+57.78%)
Mutual labels:  virtualization
Zelda.RISCV.Emulator
A System Level RISCV32 Emulator Over x86_64: capable of booting RISCV Linux
Stars: ✭ 18 (-60%)
Mutual labels:  virtualization
l1vm
L1VM - a tiny virtual machine with a 64 bit core
Stars: ✭ 112 (+148.89%)
Mutual labels:  virtual
robinjs-website
Alexa like assistant in 40 lines of code
Stars: ✭ 31 (-31.11%)
Mutual labels:  virtual
uvmm
Virtual machine monitor for L4Re
Stars: ✭ 22 (-51.11%)
Mutual labels:  virtualization
haaukins
A Highly Accessible and Automated Virtualization Platform for Security Education
Stars: ✭ 148 (+228.89%)
Mutual labels:  virtualization
figaro
Real-time voice-changer for voice-chat, etc. Will support many different voice-filters and features in the future. 🎵
Stars: ✭ 362 (+704.44%)
Mutual labels:  virtual
react-functional-select
Micro-sized & micro-optimized select component for React.js
Stars: ✭ 165 (+266.67%)
Mutual labels:  virtualization
MoPlugs
MotionBuilder Extensions Pack
Stars: ✭ 27 (-40%)
Mutual labels:  virtual
Imm2Virtual
This is a GUI (for Windows 64 bit) for a procedure to virtualize your EWF(E01), DD (raw), AFF disk image file without converting it, directly with VirtualBox, forensically proof.
Stars: ✭ 40 (-11.11%)
Mutual labels:  virtualization
vminspect
Tools for inspecting disk images
Stars: ✭ 25 (-44.44%)
Mutual labels:  virtualization
react-virtual-container
Optimise your React apps by only rendering components when in proximity to the viewport.
Stars: ✭ 52 (+15.56%)
Mutual labels:  virtual
visage
Add virtual makeup to picture of a face.
Stars: ✭ 97 (+115.56%)
Mutual labels:  virtual
stackbuilder
Stackbuilder builds stacks of virtual machines
Stars: ✭ 21 (-53.33%)
Mutual labels:  virtualization
janusweb
An in-browser implementation of JanusVR
Stars: ✭ 145 (+222.22%)
Mutual labels:  virtual
Anatomy-of-System-Engineering
System Engineering Memory Map
Stars: ✭ 17 (-62.22%)
Mutual labels:  virtualization
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (+2191.11%)
Mutual labels:  virtualization
aurelia-virtual-scroll
Aurelia Virtual Scroller
Stars: ✭ 15 (-66.67%)
Mutual labels:  virtualization
Hypervisor
Hypervisor implementation for x86_64 ISA MIT JOS
Stars: ✭ 25 (-44.44%)
Mutual labels:  virtualization

npm-version license js-standard-style travis-ci

README 中文

react-virtual-list

A tiny virtualization list component, supports dynamic height.

Attention: On iOS UIWebViews, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed. See more

Install

Using npm or yarn:

// npm
npm install @dwqs/react-virtual-list --save

// yarn
yarn add @dwqs/react-virtual-list

Basic usage

import React, { Component } from 'react'
import VirtualizedList from '@dwqs/react-virtual-list'

export default class Hello extends Component {
  constructor (props) {
    super(props)
    this.data = [{
      id: 1,
      val: Math.random()
    }, {
      id: 2,
      val: Math.random()
    }, {
      id: 3,
      val: Math.random()
    }, ...]

    this.renderItem = this.renderItem.bind(this)
  }

  renderItem ({index, isScrolling}) {
    const item = this.data[index]
    return (
      <div>#{index}, {item.val}</div>
    )
  }

  render () {
    return (
      <VirtualizedList
        itemCount={this.data.length}
        estimatedItemHeight={20}
        renderItem={this.renderItem}
      />
    )
  }
}

Check out the online demo here

Prop Types

Property Type Default Required? Description
itemCount Number The number of items you want to render
renderItem Function Responsible for rendering an item given its index and itself: ({index: number, isScrolling: boolean}):React.PropTypes.node
overscanCount Number 5 Number of extra buffer items to render above/below the visible items. Tweaking this can help reduce scroll flickering on certain browsers/devices
estimatedItemHeight Number 175 The estimated height of the list item element, which is used to estimate the total height of the list before all of its items have actually been measured
className String '' Class names of the wrapper element
onScroll Function () => {} Callback invoked whenever the scroll offset changes within the inner scrollable region: ({scrollTop: number}):void
loadMoreItems Function () => {} Used to infinite scroll. Callback to be invoked when more items must be loaded
onLoading Function () => null Used to infinite scroll. The component will show when loading next page data
onEnded Function () => null Used to infinite scroll. The component will show when no more data to load
hasMore Boolean false Used to infinite scroll. Whether has more data to load
height Number undefined Height of the wrapper element. If useWindow is false and scrollableTarget is undefined, the wrapper element will be the scrollable target
useWindow Boolean true Whether to set the window to scrollable target
scrollableTarget String undefined Set the scrollable target, whose value is used to document.getElementById. window is the default scrollable target, so if you want to change it, you need to set useWindow to false and dont set the height prop
noContentRenderer Function () => null Callback used to render placeholder content when itemCount is 0

Development

git clone [email protected]:dwqs/react-virtual-list.git

cd react-virtual-list

npm i 

npm run dev

LICENSE

This repo is released under the MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].