Library / SDK
petyosi/react-virtuoso avatar
petyosi/react-virtuoso

Variable height lists, grouped headers and chat scroll: inside React Virtuoso

The most powerful virtual list component for React

6,491 stars370 forksTypeScriptLicense varies

At a glance

What is it?
React Virtuoso is a pnpm published family of React list components that renders rows of unknown height, grouped sections, grids and chat history. The variable height rendering is what it genuinely solves; layout, licensing paperwork and the missing props reference are not.
Who is it for?
Adopt React Virtuoso when your rows have no knowable height and you would rather not write the measurement code yourself: that is the one problem the family solves well, and a 400 pixel container plus a totalCount proves the shape in an afternoon. Skip it if your rows are fixed height, if you need a props reference inside the repository instead of on virtuoso.dev, or if an automated licence scan requires a LICENSE file that the top level does not contain.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • petyosi/react-virtuoso6,491 ★ · +30
Star history
Repository2026-09-232026-11-22
petyosi/react-virtuoso6.5k6.5k

30 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Variable height rows with no hard-coded item heights

Long React lists break in a predictable place: nobody can say how tall a row is before it renders. React Virtuoso's answer is to stop asking. Variable sized items work out of the box, and no manual measurements or hard-coding of item heights is necessary. A separate capability handles content resize automatically, so a row that grows when an image finishes loading or a chart draws does not need a measured height either.

That decision is why one package ships so many shapes. A flat Virtuoso, a GroupedVirtuoso with sticky headers, a VirtuosoGrid of same sized cells, a Masonry layout and a TableVirtuoso all rest on the same premise: the container does not need row geometry up front.

The reader who benefits is any team whose list is long enough that mounting every node hurts, or whose rows change size after first paint. A twelve item dropdown is the wrong shape of problem. The code is TypeScript, the default branch is main, and the depth lives on virtuoso.dev rather than inside the repository: the README is a directory of links to per feature pages with live examples, which is also its main weakness.

totalCount and itemContent are the whole flat list contract

The smallest useful example hands a Virtuoso a height, a totalCount and an itemContent callback. totalCount is a number, 200 in the sample. itemContent receives the zero based index and returns the node for that row. Nothing else is required, and nothing else is passed.

The consequence is that the component indexes your data without owning it. The README sample passes no data prop and declares no item shape, so the mapping from index to record lives inside your callback, and every list you build on that arrangement inherits the same indirection.

The remaining flat list links point at behaviour rather than configuration: endless scrolling, press to load more, an initial top most item index, a scroll to index method, pinned top items, and custom header, footer and empty list components. Notice what that catalogue leaves out. No props table, no defaults, no note about when a callback has to be memoised. A team that needs the exact contract of any one of those has to leave the repository for the documentation site.

GroupedVirtuoso replaces totalCount with groupCounts

Grouping changes the contract instead of adding to it. GroupedVirtuoso exposes groupCounts: number[] in place of totalCount, and passing [20, 30] renders two groups holding 20 and 30 items each. itemContent stays, and a second callback, groupContent, becomes required rather than optional. That callback receives the zero based group index, which is your only handle on a group's own position, since the count array carries sizes and nothing else. The header text comes from your code.

groupCounts is an array of numbers, not a function over items, so group boundaries have to exist before the component renders. A directory whose group sizes are computed from a response that has not arrived does not fit that shape without a second pass over the data.

Nothing in the repository says whether GroupedVirtuoso can switch between two count shapes at runtime, or how it behaves when the array length shrinks under it. That gap matters for filtered lists, where the usual move is to keep the component mounted and hand it new counts.

VirtuosoGrid puts sizing in CSS, TableVirtuoso keeps table markup

VirtuosoGrid is the component that gives the sizing back to you. It displays same sized items across multiple columns, and both layout and item sizing are controlled through CSS class properties, which is what lets media queries, min-width and percentage do the responsive work. In exchange for the automatic height handling that flat Virtuoso provides, you now own the row height in your stylesheet, and the column count becomes a CSS decision rather than a prop.

Masonry sits between the two positions. It renders columns from varying height items, the shape the documentation points at product listings and image galleries, where a grid would force every cell to the tallest item in the set.

TableVirtuoso works just like Virtuoso but over HTML tables. It supports window scrolling, sticky headers and sticky columns, and the project says it works with Tanstack Table and MUI Table. That wording matters: works with is not wraps. The column definition still lives in whichever table library you picked.

MessageList owns scroll position when older messages arrive

The message list component is built for human and chatbot conversations, and its difference is not layout but data control. Alongside virtualized rendering it exposes an imperative data management API, so the caller decides what happens to the scroll position in the three moments that matter: older messages load, new messages arrive, and the user submits a message. The position can update instantly or through a smooth scroll animation.

Set that against the flat component and the split becomes clear. A plain Virtuoso hands you indexes and expects your code to fetch data; the message list takes over the sequence. Keeping the viewport pinned to the newest message while a scrollback request resolves is a piece of state that has to live somewhere, and here it lives in the component rather than in your store.

The price is a narrower surface. The imperative API is specific to conversations, so the endless scrolling and press to load more paths documented for the flat list are not the same thing as chat backfill, and the repository does not document moving a paginated table onto it.

First render: npm install react-virtuoso with totalCount 200

Install the package into the React app that owns the list:

bash
npm install react-virtuoso

The component itself is one import and one element. Follow the shape the project gives you: a fixed pixel height on the container, a totalCount, and an itemContent callback that receives the index.

jsx
import * as React from 'react'
import { Virtuoso } from 'react-virtuoso'

const App = () => {
  return <Virtuoso style={{ height: '400px' }} totalCount={200} itemContent={(index) => <div>Item {index}</div>} />
}

Rendered, you get a 400 pixel tall scroller holding rows labelled Item 0, Item 1 and onwards, with only the visible slice present in the DOM. The sample mounts through ReactDOM.render(<App />, document.getElementById('root')), so the host page needs an element carrying that id.

Swap totalCount for the length of your own array and read the index against it inside itemContent. That is the whole wiring: no measurements, no height constants, no scroll arithmetic in your code.

The MIT line sits in the README, with no LICENSE file above it

The README closes with MIT License. The top level entries of the repository hold no LICENSE file, so the grant exists as a line of prose rather than something an automated scan or a legal review can read off disk. Anyone shipping this inside a product should copy that licence text into their own notices instead of assuming the package directory carries it.

Activity is visible in the release record. The last push was on 2026-11-02. The three most recent releases are react-virtuoso at 4.18.19 on 2026-10-13, @virtuoso.dev/reactive-engine-query at 2.0.2 on 2026-10-14, and react-virtuoso at 4.18.20 on 2026-10-29.

Versioning runs on changesets inside a private pnpm workspace named @virtuoso.dev/monorepo, and the release script shows the shape of a cut:

json
"release": "pnpm build && pnpm exec changeset publish"

The ci script is the other line worth reading, since it names every gate a change has to clear before it ships:

json
"ci": "pnpm ci-setup && pnpm format:check && pnpm build && pnpm typecheck && pnpm lint && pnpm lint:md && pnpm test && pnpm e2e"

What the repository does not settle about your own rows

The documentation lives on virtuoso.dev. Inside the repository, silence is the norm, and the silences that cost time are specific ones. No React peer version range appears in the README, so an application on a version the sample predates has to discover the answer by trying. The example calls ReactDOM.render on document.getElementById('root'), and no createRoot variant sits beside it. There is no accessibility documentation, no server rendering or hydration note, and no guidance on scroll anchoring when a row above the viewport changes height.

Container height is the quieter constraint. The flat sample is 400 pixels tall by construction, so the component needs a parent with a decided height. A list that should grow with the page is a different arrangement, and TableVirtuoso is the one documented as supporting window scrolling.

Then the absence that decides migrations: no competing virtualization library is named anywhere, so react-window or react-virtualized cannot be set against this one from the repository alone. What can be set against it is the row height story. With fixed height rows, a fixed row list is less machinery and fewer props. With rows that change, the absence of any measurement code in your own component is what this family buys, and that is the trade to make explicitly rather than by default.

Editorial conclusion

Adopt React Virtuoso when your rows have no knowable height and you would rather not write the measurement code yourself: that is the one problem the family solves well, and a 400 pixel container plus a totalCount proves the shape in an afternoon. Skip it if your rows are fixed height, if you need a props reference inside the repository instead of on virtuoso.dev, or if an automated licence scan requires a LICENSE file that the top level does not contain. Before committing, copy the MIT line into your own notices and confirm that your React version still accepts the ReactDOM.render call in the sample, because the README states no peer version range.

Frequently asked questions

What is React Virtuoso?

React Virtuoso is a family of React virtualization components for lists whose row heights are not known in advance, including flat, grouped, grid, masonry and table variants plus a message list. It installs with npm install react-virtuoso and the package code is TypeScript.

How do you use React Virtuoso?

Render a Virtuoso with a height, a totalCount and an itemContent callback that receives the zero based index, then read your own data by that index inside the callback. Grouped mode swaps totalCount for groupCounts and adds a required groupContent callback that receives the group index.

Is React Virtuoso free?

It is published to the npm registry as react-virtuoso, which is 4.18.20 as of 2026-10-29. The README states MIT License, although no LICENSE file appears among the top level entries of the repository.

React Virtuoso vs react virtualized: what actually differs?

The repository documentation names no competing virtualization library and draws no comparison. What it does state is its own axis: variable sized items render with no manual measurement and no hard coded item heights, which is where any comparison has to start.

Which React virtualization library is the best?

The project makes no ranking claim against other libraries. Its documented scope is narrower: variable height rows, sticky grouped headers, responsive grids and chat scroll control, released through changesets in a pnpm monorepo under an MIT licence.

Official sources

  1. Issues
  2. petyosi/react-virtuoso on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/petyosi-react-virtuoso.svg)](https://hysenlabs.com/projects/petyosi-react-virtuoso)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/petyosi-react-virtuoso.svg)](https://hysenlabs.com/projects/petyosi-react-virtuoso)

Was this useful?