프로젝트
GitHub에서 보기
react-component/virtual-list
소개
📜 React용 가상 스크롤 목록 컴포넌트입니다.
웹 및 앱 개발What you can do
- Built for React and maintained by the rc-component team.
- Used by Ant Design and other React component libraries.
- Ships TypeScript declarations with both ES module and CommonJS outputs.
- Keeps examples, tests, and preview builds aligned with the package source.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original@rc-component/virtual-list
Part of the Ant Design ecosystem.
📜 Virtual scrolling list component for React.
English | 简体中文
Highlights
- Built for React and maintained by the rc-component team.
- Used by Ant Design and other React component libraries.
- Ships TypeScript declarations with both ES module and CommonJS outputs.
- Keeps examples, tests, and preview builds aligned with the package source.
Install
npm install @rc-component/virtual-list
Usage
import List from '@rc-component/virtual-list';
const data = Array.from({ length: 1000 }).map((_, index) => ({
id: index,
label: `Item ${index}`,
}));
export default () => (
<List data={data} height={240} itemHeight={32} itemKey="id">
{(item) => <div>{item.label}</div>}
</List>
);
Examples
Run the local dumi site:
npm install
npm start
Then open http://localhost:8000.
API
List
| Prop | Description | Type | Default |
|---|---|---|---|
| children | Render function for each item. The third argument contains measuring props used by legacy browser compatibility paths. | (item, index, props) => ReactElement |
- |
| component | Custom list container element. | string | ComponentType |
div |
| data | Items rendered by the virtual list. | T[] |
- |
| fullHeight | Whether the holder should keep full height. | boolean |
true |
| height | Visible list height. | number |
- |
| itemHeight | Minimum item height used to calculate the virtual range. | number |
- |
| itemKey | Key field or key getter for items. | string | (item) => React.Key |
- |
| onScroll | Called when the list scrolls. | React.UIEventHandler<HTMLElement> |
- |
| styles | Custom scrollbar part styles. | object |
- |
| virtual | Enable virtual rendering. | boolean |
true |
Development
npm install
npm start
npm test
npm run build
The dumi site runs at http://localhost:8000 by default.
Release
npm run prepublishOnly
The release flow is handled by @rc-component/np through the rc-np command after the package build.
License
@rc-component/virtual-list is released under the MIT license.
관련 프로젝트 살펴보기
불러오는 중…