This project demonstrates how to efficiently render a large list (5000+ items) using react-virtualized in React. It improves performance by only rendering visible items instead of the entire list.
- ⚡ High-performance list rendering with virtualization
- 📏 Auto responsive sizing using
AutoSizer - 🧠 Efficient rendering using
Listcomponent - 📝 Dynamic content generation using
lorem-ipsum - 🖼️ Image + text list items
- 🔄 Smooth scrolling with overscan optimization
- React
- react-virtualized
- lorem-ipsum
- CSS
src/ │ ├── components/ │ └── ListItem.jsx │ ├── App.js ├── App.css └── index.js
---
## 📦 Installation
# Clone the repository
git clone https://github.com/DeveloperMonirBD/react-virtualized-list.git
# Navigate into the project
cd react-virtualized-list
# Install dependencies
npm install
npm startApp will run at:
http://localhost:5173
react-virtualizedrenders only the visible rows in the viewport.AutoSizerautomatically adjusts width and height based on the container.Listcomponent handles rendering large datasets efficiently.
<AutoSizer>
{({ width, height }) => (
<List
width={width}
height={height}
rowHeight={50}
rowCount={5000}
rowRenderer={renderRow}
overscanRowCount={5}
/>
)}
</AutoSizer>- Use
useMemoto avoid recreating large datasets on every render. - Use
React.memofor list items to prevent unnecessary re-renders. - Keep row height fixed for better performance.
npm install react-virtualized lorem-ipsum- 👤 Name
- 🖼️ Image (placeholder)
- 📝 Random sentence (generated via lorem-ipsum)
- Chat applications
- Infinite scrolling feeds
- Large data tables
- Logs viewer
- Social media feeds
Contributions are welcome! Feel free to fork this repo and submit a pull request.
If you like this project, give it a ⭐ on GitHub!