{"name":"@rc-component/listy","version":"1.2.1","keywords":["react","react-component","list","high performance","headless ui"],"author":"","license":"MIT","_id":"@rc-component/listy@1.2.1","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://github.com/react-component/listy","bugs":{"url":"https://github.com/react-component/listy/issues"},"dist":{"shasum":"ff5a35321fdc1b5012ae29a091b7ab1ee3bd93e4","tarball":"http://registry-npm.ywwl.com/@rc-component/listy/download/@rc-component/listy-1.2.1.tgz","fileCount":41,"integrity":"sha512-SI2L31S+aJWJUiTsyei6FyNl/l1c5rSYUJm/7mWR2LSXV4DHa8uOUVjecD2Sv5qLizyS4fFVx4g082+vDME7+Q==","signatures":[{"sig":"MEQCIC5invEt/9+dcKrQqGLqskVKEKwQ6W/5ZOIm9nIf/dI9AiAXdzvzR6Nk43GL2KeE3pFzjy7BgiXUwhnbqbNIwYKUgA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69475,"size":11447,"noattachment":false,"key":"/@rc-component/listy/-/@rc-component/listy-1.2.1.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","gitHead":"d02240502b83e68b6eb2d35f3da40c473890fb81","scripts":{"lint":"eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","coverage":"rc-test --coverage","prettier":"prettier --write .","now-build":"npm run build","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/listy.git","type":"git"},"_npmVersion":"11.7.0","description":"React Listy Component","directories":{},"_nodeVersion":"22.15.1","dependencies":{"clsx":"^2.1.1","@rc-component/util":"^1.3.1","@rc-component/motion":"^1.1.4","@rc-component/portal":"^2.0.0","@rc-component/virtual-list":"^1.2.0","@rc-component/resize-observer":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.21","less":"^4.4.2","react":"^19.2.0","eslint":"^8.57.1","father":"^4.6.7","rc-test":"^7.1.2","prettier":"^3.6.2","cross-env":"^10.1.0","react-dom":"^19.2.0","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^24.10.0","@types/react":"^19.2.2","@umijs/fabric":"^4.0.1","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.2","@types/classnames":"^2.3.4","regenerator-runtime":"^0.14.1","@testing-library/react":"^16.3.0","@testing-library/jest-dom":"^6.9.1","@rc-component/father-plugin":"^2.1.3"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/listy_1.2.1_1782960620931_0.7963084154276885","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/listy</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/listy\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/listy.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/listy\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/listy.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/listy/actions/workflows/test.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/listy/actions/workflows/test.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/listy\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/listy/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/listy\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/listy?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| 方向 | 支持 |\n| --- | --- |\n| 定位 | 支持虚拟滚动、分组与粘性组头的 React 列表组件。 |\n| 包名 | `@rc-component/listy` |\n| 发布 | `@rc-component/np` / `rc-np` |\n\n## 安装\n\n```bash\nnpm install @rc-component/listy\n```\n\n## 用法\n\n```tsx | pure\nimport Listy from '@rc-component/listy';\nimport '@rc-component/listy/assets/index.css';\n\nconst items = Array.from({ length: 100 }, (_, index) => ({ id: index, name: `Item ${index}` }));\n\nexport default () => (\n  <Listy\n    items={items}\n    height={240}\n    itemHeight={32}\n    rowKey=\"id\"\n    itemRender={(item) => <div>{item.name}</div>}\n  />\n);\n```\n\n## API\n\n| 名称 | 说明 | 类型 | 默认值 |\n| --- | --- | --- | --- |\n| `items` | 列表数据源。 | `T[]` | `[]` |\n| `rowKey` | 解析列表项唯一标识。 | `keyof T \\| (item: T, index: number) => React.Key` | 必填 |\n| `itemRender` | 渲染每一项。 | `(item: T, index: number) => React.ReactNode` | 必填 |\n| `height` | 可视区域高度。 | `number` | - |\n| `itemHeight` | 预估项高度。 | `number` | - |\n| `group` | 分组配置。 | `{ key: (item: T) => K; title: (groupKey: K, items: T[]) => React.ReactNode }` | - |\n| `sticky` | 启用粘性组头。 | `boolean` | `false` |\n| `virtual` | 启用虚拟滚动。 | `boolean` | `true` |\n| `scrollWidth` | 内容实际宽度，仅在 `virtual` 开启时生效。设置后会展示横向滚动条。 | `number` | - |\n| `direction` | 布局方向，设为 `rtl` 时启用从右到左布局。 | `'ltr' \\| 'rtl'` | `'ltr'` |\n| `onScroll` | 内部滚动容器滚动时触发。 | `React.UIEventHandler<HTMLElement>` | - |\n| `prefixCls` | 组件样式前缀。 | `string` | `rc-listy` |\n\n### ListyRef\n\n| 方法 | 说明 |\n| --- | --- |\n| `scrollTo(config)` | 滚动到指定位置、列表项 key 或分组 key。 |\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run lint\nnpm run compile\n```\n\n本地 dumi 站点默认运行在 `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/listy 基于 [MIT](./LICENSE) 协议发布。\n","publish_time":1782960621077,"_cnpm_publish_time":1782960621077,"dist-tags":{"latest":"1.4.0"}}