react-window vs react-virtualized vs react-window-infinite-loader vs react-list vs react-virtual vs react-infinite
無限スクロールライブラリ
react-windowreact-virtualizedreact-window-infinite-loaderreact-listreact-virtualreact-infinite類似パッケージ:

無限スクロールライブラリ

無限スクロールライブラリは、長いリストやグリッドを効率的に表示するためのツールです。これらのライブラリは、ユーザーがスクロールする際に新しいデータを動的に読み込むことを可能にし、パフォーマンスを最適化し、ユーザー体験を向上させます。これにより、ページの読み込み時間を短縮し、スムーズなインターフェースを提供します。

npmのダウンロードトレンド

3 年

GitHub Starsランキング

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
react-window4,169,69917,128209 kB11ヶ月前MIT
react-virtualized1,354,08727,0822.24 MB11年前MIT
react-window-infinite-loader532,82495223 kB02ヶ月前MIT
react-list402,3201,97434.9 kB711年前MIT
react-virtual401,1896,760158 kB105-MIT
react-infinite7,6162,687243 kB102-BSD-3-Clause

機能比較: react-window vs react-virtualized vs react-window-infinite-loader vs react-list vs react-virtual vs react-infinite

パフォーマンス最適化

  • react-window:

    react-windowは、軽量で高速な仮想化を実現し、パフォーマンスを向上させます。

  • react-virtualized:

    react-virtualizedは、複雑なリストやグリッドのパフォーマンスを最適化するための多くの機能を提供します。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、無限スクロールを実現し、データの読み込みを効率化します。

  • react-list:

    react-listは、可変サイズのアイテムをサポートし、必要なアイテムだけを表示することで、パフォーマンスを向上させます。

  • react-virtual:

    react-virtualは、表示されているアイテムの数を制限することで、パフォーマンスを向上させます。

  • react-infinite:

    react-infiniteは、リストのアイテムを効率的にレンダリングし、必要なデータのみを読み込むことでパフォーマンスを最適化します。

使いやすさ

  • react-window:

    react-windowは、シンプルで直感的なAPIを提供し、使いやすさが特徴です。

  • react-virtualized:

    react-virtualizedは、多機能ですが、やや複雑なAPIを持ち、学習コストが高いです。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、react-windowと組み合わせて使用することで、無限スクロールを簡単に実装できます。

  • react-list:

    react-listは、可変サイズのアイテムを簡単に扱えるAPIを提供します。

  • react-virtual:

    react-virtualは、仮想化の概念を簡単に理解できるように設計されています。

  • react-infinite:

    react-infiniteは、シンプルなAPIを提供し、簡単に無限スクロールを実装できます。

カスタマイズ性

  • react-window:

    react-windowは、シンプルな構造でありながら、カスタマイズ可能なオプションを提供します。

  • react-virtualized:

    react-virtualizedは、非常に高いカスタマイズ性を持ち、さまざまなシナリオに対応できます。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、react-windowの機能を拡張する形でカスタマイズが可能です。

  • react-list:

    react-listは、リストのアイテムを自由にカスタマイズできる柔軟性があります。

  • react-virtual:

    react-virtualは、仮想化の設定を詳細にカスタマイズできます。

  • react-infinite:

    react-infiniteは、基本的な無限スクロール機能に特化しており、カスタマイズの余地が少ないです。

サポートされるデータ形式

  • react-window:

    react-windowは、シンプルなリストデータを効率的に扱います。

  • react-virtualized:

    react-virtualizedは、リストやグリッドなど、さまざまなデータ形式をサポートしています。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、無限スクロールに特化しており、データの読み込みを効率化します。

  • react-list:

    react-listは、可変サイズのアイテムを扱うことができ、さまざまなデータ形式に対応します。

  • react-virtual:

    react-virtualは、仮想化されたリストをサポートし、データ形式に柔軟性があります。

  • react-infinite:

    react-infiniteは、主にリスト形式のデータをサポートします。

コミュニティとサポート

  • react-window:

    react-windowは、人気のあるライブラリであり、活発なコミュニティがあります。

  • react-virtualized:

    react-virtualizedは、広範なユーザー基盤を持ち、サポートが豊富です。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、react-windowのエコシステムの一部であり、サポートが充実しています。

  • react-list:

    react-listは、活発なコミュニティがあり、サポートが充実しています。

  • react-virtual:

    react-virtualは、比較的新しいライブラリですが、成長中のコミュニティがあります。

  • react-infinite:

    react-infiniteは、比較的小さなコミュニティを持ち、サポートが限られています。

選び方: react-window vs react-virtualized vs react-window-infinite-loader vs react-list vs react-virtual vs react-infinite

  • react-window:

    react-windowは、シンプルで軽量な仮想化ライブラリを求める場合に最適です。特に、パフォーマンスが重要な場合に適しています。

  • react-virtualized:

    react-virtualizedは、複雑なリストやグリッドの表示に対応しており、さまざまな機能を提供します。多機能であり、カスタマイズ性が高いのが特徴です。

  • react-window-infinite-loader:

    react-window-infinite-loaderは、react-windowと組み合わせて使用することで、無限スクロールを実現します。特に、データの読み込みが必要な場合に便利です。

  • react-list:

    react-listは、リストのアイテムが可変サイズであり、パフォーマンスを重視する場合に適しています。特に、リストが大きくなる場合に有用です。

  • react-virtual:

    react-virtualは、仮想化されたリストを簡単に作成したい場合に適しています。特に、リストのアイテムが多く、表示するアイテム数が限られている場合に効果的です。

  • react-infinite:

    react-infiniteは、シンプルな無限スクロールを必要とする場合に最適です。特に、リストのアイテムが固定サイズである場合に効果的です。

react-window のREADME

react-window logo

react-window is a component library that helps render large lists of data quickly and without the performance problems that often go along with rendering a lot of data. It's used in a lot of places, from React DevTools to the Replay browser.

Support

If you like this project there are several ways to support it:

The following wonderful companies and individuals have sponsored react-window:

Installation

Begin by installing the library from NPM:

npm install react-window

TypeScript types

TypeScript definitions are included within the published dist folder

FAQs

Frequently asked questions can be found here.

Documentation

Documentation for this project is available at react-window.vercel.app; version 1.x documentation can be found at react-window-v1.vercel.app.

List

Renders data with many rows.

Required props

NameDescription
rowComponent

React component responsible for rendering a row.

This component will receive an index and style prop by default. Additionally it will receive prop values passed to rowProps.

ℹ️ The prop types for this component are exported as RowComponentProps

rowCount

Number of items to be rendered in the list.

rowHeight

Row height; the following formats are supported:

  • number of pixels (number)
  • percentage of the grid's current height (string)
  • function that returns the row height (in pixels) given an index and cellProps
  • dynamic row height cache returned by the useDynamicRowHeight hook

⚠️ Dynamic row heights are not as efficient as predetermined sizes. It's recommended to provide your own height values if they can be determined ahead of time.

rowProps

Additional props to be passed to the row-rendering component. List will automatically re-render rows when values in this object change.

⚠️ This object must not contain ariaAttributes, index, or style props.

Optional props

NameDescription
className

CSS class name.

style

Optional CSS properties. The list of rows will fill the height defined by this style.

children

Additional content to be rendered within the list (above cells). This property can be used to render things like overlays or tooltips.

defaultHeight

Default height of list for initial render. This value is important for server rendering.

listRef

Ref used to interact with this component's imperative API.

This API has imperative methods for scrolling and a getter for the outermost DOM element.

ℹ️ The useListRef and useListCallbackRef hooks are exported for convenience use in TypeScript projects.

onResize

Callback notified when the List's outermost HTMLElement resizes. This may be used to (re)scroll a row into view.

onRowsRendered

Callback notified when the range of visible rows changes.

overscanCount

How many additional rows to render outside of the visible area. This can reduce visual flickering near the edges of a list when scrolling.

tagName

Can be used to override the root HTML element rendered by the List component. The default value is "div", meaning that List renders an HTMLDivElement as its root.

⚠️ In most use cases the default ARIA roles are sufficient and this prop is not needed.

Grid

Renders data with many rows and columns.

ℹ️ Unlike List rows, Grid cell sizes must be known ahead of time. Either static sizes or something that can be derived (from the data in CellProps) without rendering.

Required props

NameDescription
cellComponent

React component responsible for rendering a cell.

This component will receive an index and style prop by default. Additionally it will receive prop values passed to cellProps.

ℹ️ The prop types for this component are exported as CellComponentProps

cellProps

Additional props to be passed to the cell-rendering component. Grid will automatically re-render cells when values in this object change.

⚠️ This object must not contain ariaAttributes, columnIndex, rowIndex, or style props.

columnCount

Number of columns to be rendered in the grid.

columnWidth

Column width; the following formats are supported:

  • number of pixels (number)
  • percentage of the grid's current width (string)
  • function that returns the column width (in pixels) given an index and cellProps
rowCount

Number of rows to be rendered in the grid.

rowHeight

Row height; the following formats are supported:

  • number of pixels (number)
  • percentage of the grid's current height (string)
  • function that returns the row height (in pixels) given an index and cellProps

Optional props

NameDescription
className

CSS class name.

dir

Indicates the directionality of grid cells.

ℹ️ See HTML dir global attribute for more information.

style

Optional CSS properties. The grid of cells will fill the height and width defined by this style.

children

Additional content to be rendered within the grid (above cells). This property can be used to render things like overlays or tooltips.

defaultHeight

Default height of grid for initial render. This value is important for server rendering.

defaultWidth

Default width of grid for initial render. This value is important for server rendering.

gridRef

Imperative Grid API.

ℹ️ The useGridRef and useGridCallbackRef hooks are exported for convenience use in TypeScript projects.

onCellsRendered

Callback notified when the range of rendered cells changes.

onResize

Callback notified when the Grid's outermost HTMLElement resizes. This may be used to (re)scroll a cell into view.

overscanCount

How many additional rows/columns to render outside of the visible area. This can reduce visual flickering near the edges of a grid when scrolling.

tagName

Can be used to override the root HTML element rendered by the List component. The default value is "div", meaning that List renders an HTMLDivElement as its root.

⚠️ In most use cases the default ARIA roles are sufficient and this prop is not needed.