virtualization
БесплатноБез исполняемых скриптовНе проверенMUI list virtualization with react-window, react-virtuoso, virtualized Autocomplete, and large dataset rendering patterns
от TheLobbi★ 22 звезды на GitHubОб этом скилле
MUI Virtualization
Why Virtualize
Rendering 1000+ DOM nodes causes:
- Layout thrashing — the browser recalculates layout for every node on scroll
- Memory pressure — each MUI ListItem creates 3-5 DOM elements (ripple, text, icon wrappers)
- Initial paint delay — 10,000 items can take 2-4 seconds to mount
The fix: render only the visible items plus a small overscan buffer. Libraries like react-window and react-virtuoso handle the math; you supply the row renderer.
Rule of thumb: virtualize any list with more than 100 items, or any list where item count is unbounded (API-driven).
react-window with MUI
Install: npm install react-window @types/react-window
FixedSizeList with MUI ListItem
Use when every row has the same pixel height.
import { FixedSizeList, ListChildComponentProps } from 'react-window';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import ListItemAvatar from '@mui/material/ListItemAvatar';
import Avatar from '@mui/material/Avatar';
import Box from '@mui/material/Box';
interface User {
id: string;
name: string;
email: string;
avatarUrl: string;
}
interface VirtualUserListProps {
users: User[];
height?: number;
}
function renderRow(users: User[]) {
return function Row({ index, style }: ListChildComponentProps) {
const user = users[index];
return (
<ListItem
style={style} // react-window positions via inline style
key={user.id}
component="div" // avoid nested <li> issues
disablePadding
sx={{ borderBottom: 1, borderColor: 'divider' }}
>
<ListItemAvatar>
<Avatar src={user.avatarUrl} alt={user.name} />
</ListItemAvatar>
<ListItemText primary={user.name} secondary={user.email} />
</ListItem>
);
};
}
export function VirtualUserList({ users, height = 400 }: VirtualUserListProps) {
return (
<Box sx={{ width: '100%', height, bgcolor: 'background.paper' }}>
<FixedSizeList
height={height}
width="100%"
itemSize={72} // must match actual row height
itemCount={users.length}
overscanCount={5} // render 5 extra rows above/below viewport
>
{renderRow(users)}
</FixedSizeList>
</Box>
);
}
VariableSizeList with MUI ListItem
Use when rows have different heights (e.g., multi-line text, expandable content).
import { VariableSizeList } from 'react-window';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import { useRef, useCallback } from 'react';
interface Message {
id: string;
sender: string;
body: string;
}
interface VirtualMessageListProps {
messages: Message[];
height?: number;
}
// Estimate height based on text length; refine with measureRef if needed
function getItemSize(messages: Message[]) {
return (index: number): number => {
const body = messages[index].body;
if (body.length < 80) return 56;
if (body.length < 200) return 80;
return 120;
};
}
export function VirtualMessageList({ messages, height = 500 }: VirtualMessageListProps) {
const listRef = useRef<VariableSizeList>(null);
// Call this after data changes to recalculate sizes
const resetSizes = useCallback(() => {
listRef.current?.resetAfterIndex(0, true);
}, []);
return (
<VariableSizeList
ref={listRef}
height={height}
width="100%"
itemCount={messages.length}
itemSize={getItemSize(messages)}
overscanCount={3}
>
{({ index, style }) => {
const msg = messages[index];
return (
<ListItem style={style} component="div" alignItems="flex-start">
<ListItemText
primary={msg.sender}
secondary={msg.body}
secondaryTypographyProps={{
sx: {
display: '-webkit-box',
WebkitLineClamp: 3,
WebkitBoxOrient: 'vertical',
overflow: 'hidden',
},
}}
/>
</ListItem>
);
}}
</VariableSizeList>
);
}
Key gotcha: When data changes, call listRef.current.resetAfterIndex(0, true) to
force VariableSizeList to recalculate cached sizes.
react-virtuoso with MUI
Install: npm install react-virtuoso
Virtuoso handles variable-height items automatically (no itemSize function needed)
and supports grouped lists, headers, footers, and scroll-to-index out of the box.
Basic Virtuoso with MUI List Components
import { Virtuoso } from 'react-virtuoso';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemTex
Установить virtualization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGlobGrepWriteEditFAQ
Что делает скилл virtualization?
MUI list virtualization with react-window, react-virtuoso, virtualized Autocomplete, and large dataset rendering patterns
Как установить скилл virtualization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл virtualization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic