
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@lsky/v-table
Advanced tools
React components for render table with virtual
$ npm i @lsky/v-table
$ yarn add @lsky/v-table
$ npm i react react-dom
import React from 'react'
import VTable from '@lsky/v-table'
class Index extends React.PureComponent {
tableRender({
rowIndex, columnIndex, key, style,
}) {
return (
<div key={key} style={style}>{`row-${rowIndex}-col-${columnIndex}`}</div>
)
}
render() {
return (
<VTable
width={860}
height={600}
rowHeight={40}
columnWidth={100}
columnCount={100}
rowCount={1000}
render={this.tableRender}
/>
)
}
}
Adaptivecomponent will adapt the container width and height, and return the width and height value.
Warning: The parent element must have relative attr.
import React from 'react'
import VTable, { Adaptive } from '@lsky/v-table'
class Index extends React.PureComponent {
tableRender({
rowIndex, columnIndex, key, style,
}) {
return (
<div key={key} style={style}>{`row-${rowIndex}-col-${columnIndex}`}</div>
)
}
render() {
return (
<Adaptive>
{({ width, height }) => (
<VTable
width={width}
height={height}
rowHeight={40}
columnWidth={100}
columnCount={100}
rowCount={1000}
render={this.tableRender}
/>
)}
</Adaptive>
)
}
}
*Warning: * WindowScroller cannot be mixed with Adaptive.
import React from 'react'
import VTable, { WindowScroller } from '@lsky/v-table'
class Index extends React.PureComponent {
tableRender({
rowIndex, columnIndex, key, style,
}) {
return (
<div key={key} style={style}>{`row-${rowIndex}-col-${columnIndex}`}</div>
)
}
render() {
return (
<WindowScroller>
{({ scrollTop, scrollLeft }) => (
<VTable
width={860}
height={600}
scrollTop={scrollTop}
scrollLeft={scrollLeft}
rowHeight={40}
columnWidth={100}
columnCount={100}
rowCount={1000}
render={this.tableRender}
/>
)}
</WindowScroller>
)
}
}
| attr | type | default value | required | desc |
|---|---|---|---|---|
| columnWidth | number | ((columnIndex) => number) | null | true | column width |
| columnCount | number | null | true | column count |
| rowHeight | number | ((rowIndex) => number) | null | true | row height |
| rowCount | number | null | true | row count |
| width | number | null | true | container width |
| height | number | null | true | container height |
| scrollTop | number | null | false | scrollTop. if passed in, change to controlled component |
| scrollLeft | number | null | false | scrollLeft. if passed in, change to controlled component |
| render | (({rowIndex, columnIndex, key, style}) => React.node) | null | true | render cell |
| onScroll | (({scrollTop, scrollLeft}) => void) | null | false | onScroll |
| isWindowScroller | boolean | null | false | is use WindowScroller component wrap |
| attr | type | default value | required | desc |
|---|---|---|---|---|
| defaultWidth | number | null | false | default width |
| defaultHeight | number | null | false | default height |
| children | (({width, height}) => React.node) | null | true | children |
| attr | type | default value | required | desc |
|---|---|---|---|---|
| scrollLeft | number | null | false | scroll left |
| scrollTop | number | null | false | scroll top |
| children | (({scrollLeft, scrollTop}) => React.node) | null | true | children |
FAQs
> React components for render table with virtual
We found that @lsky/v-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.