项目作者: react-component

项目描述 :
🧾 React Virtual List Component which worked with animation
高级语言: TypeScript
项目地址: git://github.com/react-component/virtual-list.git
创建时间: 2019-07-05T08:18:55Z
项目社区:https://github.com/react-component/virtual-list

开源协议:

下载


rc-virtual-list

React Virtual List Component which worked with animation.

NPM version dumi build status Test coverage node version npm download

Online Preview

https://virtual-list-react-component.vercel.app/

Development

  1. npm install
  2. npm start
  3. open http://localhost:8000/

Feature

  • Support react.js
  • Support animation
  • Support IE11+

Install

rc-virtual-list

Usage

  1. import List from 'rc-virtual-list';
  2. <List data={[0, 1, 2]} height={200} itemHeight={30} itemKey="id">
  3. {index => <div>{index}</div>}
  4. </List>;

API

List

Prop Description Type Default
children Render props of item (item, index, props) => ReactElement -
component Customize List dom element string \ Component div
data Data list Array -
disabled Disable scroll check. Usually used on animation control boolean false
height List height number -
itemHeight Item minimum height number -
itemKey Match key with item string -
styles style { horizontalScrollBar?: React.CSSProperties; horizontalScrollBarThumb?: React.CSSProperties; verticalScrollBar?: React.CSSProperties; verticalScrollBarThumb?: React.CSSProperties; } -

children provides additional props argument to support IE 11 scroll shaking.
It will set style to visibility: hidden when measuring. You can ignore this if no requirement on IE.