{"name":"@rc-component/virtual-list","version":"1.4.0","keywords":["react","react-component","virtual-list"],"author":{"name":"smith3816@gmail.com"},"license":"MIT","_id":"@rc-component/virtual-list@1.4.0","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"homepage":"https://react-component.github.io/virtual-list","bugs":{"url":"https://github.com/react-component/virtual-list/issues"},"dist":{"shasum":"f71c23866504b9e390eb49254eca63ec3253a5ce","tarball":"http://registry-npm.ywwl.com/@rc-component/virtual-list/download/@rc-component/virtual-list-1.4.0.tgz","fileCount":88,"integrity":"sha512-qoyNStkTJQDezPjBibGA5HNxS9NiKJvemD1bLp7qfyxDlwy7ofPLUP0ZqJ47hR8AKcFaizd0AP/7QWLTLpudKQ==","signatures":[{"sig":"MEUCIHyBAqCDAxZzVhX3m8Xjueq8m12mI35P5ghnCoDb6KL5AiEAuufu7hgZHzgJDhsJHAhFmas8llze4OPRHanSvQxglaA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":150359,"size":25474,"noattachment":false,"key":"/@rc-component/virtual-list/-/@rc-component/virtual-list-1.4.0.tgz"},"main":"./lib/index","types":"./es/index.d.ts","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"3153dea0f16f3aa14992ac0b748d257037715618","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ tests/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"npm run compile && npm run docs:build","start":"dumi dev","deploy":"npm run gh-pages","compile":"father build","prepare":"husky","coverage":"rc-test --coverage","gh-pages":"npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/virtual-list.git","type":"git"},"_npmVersion":"11.7.0","description":"Virtual scrolling list component for React.","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"_nodeVersion":"22.15.1","dependencies":{"clsx":"^2.1.1","@babel/runtime":"^8.0.0","@rc-component/util":"^1.4.0","@rc-component/resize-observer":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","glob":"^13.0.6","husky":"^9.1.7","react":"^19.2.7","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","cross-env":"^10.1.0","react-dom":"^19.2.7","@eslint/js":"^10.0.1","rc-animate":"^3.1.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","@eslint/compat":"^2.1.0","@types/warning":"^3.0.4","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/virtual-list_1.4.0_1784107870984_0.8602193016204513","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/virtual-list</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Ant Design 生态的一部分。</sub></p>\n  <p>📜 React 虚拟列表组件，用于高性能渲染长列表。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/virtual-list\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/virtual-list.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/virtual-list\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/virtual-list.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/virtual-list/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/virtual-list\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/virtual-list/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/virtual-list\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/virtual-list?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n## 特性\n\n- 面向 React 构建，并由 rc-component 团队维护。\n- 被 Ant Design 使用和其他 React 组件库使用。\n- 提供 TypeScript 类型声明，同时输出 ES module 和 CommonJS 产物。\n- 示例、测试和预览构建与包源码保持一致。\n\n## 安装\n\n```bash\nnpm install @rc-component/virtual-list\n```\n\n## 使用\n\n```tsx\nimport List from '@rc-component/virtual-list';\n\nconst data = Array.from({ length: 1000 }).map((_, index) => ({\n  id: index,\n  label: `Item ${index}`,\n}));\n\nexport default () => (\n  <List data={data} height={240} itemHeight={32} itemKey=\"id\">\n    {(item) => <div>{item.label}</div>}\n  </List>\n);\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### List\n\n| 属性       | 说明                                                               | 类型                                   | 默认值  |\n| ---------- | ------------------------------------------------------------------ | -------------------------------------- | ------- |\n| children   | 每一项的渲染函数。第三个参数包含旧浏览器兼容路径使用的测量 props。 | `(item, index, props) => ReactElement` | -       |\n| component  | 自定义列表容器元素。                                               | `string` \\| `ComponentType`            | `div`   |\n| data       | 虚拟列表渲染的数据项。                                             | `T[]`                                  | -       |\n| disabled   | 禁用滚动位置检查，通常用于配合动画。                               | `boolean`                              | `false` |\n| fullHeight | holder 是否保持完整高度。                                          | `boolean`                              | `true`  |\n| height     | 可视列表高度。                                                     | `number`                               | -       |\n| itemHeight | 用于计算虚拟范围的最小项高度。                                     | `number`                               | -       |\n| itemKey    | 数据项 key 字段或 key 获取函数。                                   | `string` \\| `(item) => React.Key`      | -       |\n| onScroll   | 列表滚动时调用。                                                   | `React.UIEventHandler<HTMLElement>`    | -       |\n| styles     | 自定义滚动条部位样式。                                             | `object`                               | -       |\n| virtual    | 启用虚拟渲染。                                                     | `boolean`                              | `true`  |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run build\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/virtual-list 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1784107871123,"_cnpm_publish_time":1784107871123,"dist-tags":{"latest":"1.6.0"}}