You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-virtuoso

Package Overview
Dependencies
Maintainers
1
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-virtuoso

0.0.0-development
default-export
Source
npmnpm
Version published
Weekly downloads
1.1M
-5.67%
Maintainers
1
Weekly downloads
 
Created

What is react-virtuoso?

react-virtuoso is a performant and easy-to-use React component for rendering large lists and tabular data. It provides a virtualized list component that only renders the visible items, significantly improving performance for large datasets.

What are react-virtuoso's main functionalities?

Basic List

This code demonstrates how to create a basic virtualized list with 1000 items using react-virtuoso. Only the visible items are rendered, improving performance.

```jsx
import React from 'react';
import { Virtuoso } from 'react-virtuoso';

const App = () => (
  <Virtuoso
    totalCount={1000}
    itemContent={index => <div>Item {index}</div>}
  />
);

export default App;
```

Grouped List

This code demonstrates how to create a grouped list using react-virtuoso. The list is divided into groups, and each group and its items are rendered only when they are visible.

```jsx
import React from 'react';
import { Virtuoso } from 'react-virtuoso';

const App = () => (
  <Virtuoso
    groupCounts={[3, 2, 5]}
    groupContent={index => <div>Group {index}</div>}
    itemContent={(index, groupIndex) => <div>Item {index} in Group {groupIndex}</div>}
  />
);

export default App;
```

Table

This code demonstrates how to create a virtualized table using react-virtuoso. The table renders only the visible rows, which improves performance when dealing with large datasets.

```jsx
import React from 'react';
import { TableVirtuoso } from 'react-virtuoso';

const App = () => (
  <TableVirtuoso
    data={Array.from({ length: 1000 }, (_, index) => ({ id: index, name: `Item ${index}` }))}
    columns={[{ key: 'id', label: 'ID' }, { key: 'name', label: 'Name' }]}
    itemContent={(index, item) => (
      <tr>
        <td>{item.id}</td>
        <td>{item.name}</td>
      </tr>
    )}
  />
);

export default App;
```

Other packages similar to react-virtuoso

Keywords

react

FAQs

Package last updated on 26 Jan 2023

Did you know?

Socket

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.

Install

Related posts