Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill tanstack-virtual명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | tanstack-virtual |
| description | | Use when this capability is needed. |
npm install @tanstack/react-virtual
Three required options — everything else is optional:
count — total item count
getScrollElement — () => scrollableElement
estimateSize — (index) => number (px)
You must:
getTotalSize()virtualItem.startimport { useRef } from 'react'
import { useVirtualizer } from '@tanstack/react-virtual'
function List({ items }: { items: string[] }) {
const parentRef = useRef<HTMLDivElement>(null)
const virtualizer = useVirtualizer({
count: items.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 35,
})
return (
<div ref={parentRef} style={{ height: '400px', overflow: 'auto' }}>
<div style={{ height: `${virtualizer.getTotalSize()}px`, position: 'relative' }}>
{virtualizer.getVirtualItems().map((item) => (
<div
key={item.key}
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: `${item.size}px`,
transform: `translateY(${item.start}px)`,
}}
>
{items[item.index]}
</div>
))}
</div>
</div>
)
}
const virtualizer = useVirtualizer({
count: items.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 100, // err large for better scroll-to-index accuracy
})
{virtualizer.getVirtualItems().map((item) => (
<div
key={item.key}
data-index={item.index} // required for measureElement
ref={virtualizer.measureElement} // measures on mount/resize
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
transform: `translateY(${item.start}px)`,
// Do NOT set height — virtualizer controls it
}}
>
{items[item.index]}
</div>
))}
import { useRef, useEffect } from 'react'
import { useWindowVirtualizer } from '@tanstack/react-virtual'
function WindowList({ items }: { items: string[] }) {
const listRef = useRef<HTMLDivElement>(null)
const virtualizer = useWindowVirtualizer({
count: items.length,
estimateSize: () => 35,
scrollMargin: listRef.current?.offsetTop ?? 0,
})
return (
<div ref={listRef}>
<div style={{ height: `${virtualizer.getTotalSize()}px`, position: 'relative' }}>
{virtualizer.getVirtualItems().map((item) => (
<div
key={item.key}
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: `${}`,
`(${ })`,
}}
>
{items[item.index]}
))}
)
}
scrollMargin = distance from page top to list top. Subtract it from item.start in the transform.
virtualizer.scrollToIndex(50, { align: 'start' }) // 'start' | 'center' | 'end' | 'auto'
virtualizer.scrollToOffset(1200, { behavior: 'smooth' })
Always:
overflow: auto on scroll containerheight/width on scroll containerposition: relative on inner container sized to getTotalSize()position: absolute on each virtual itemtranslateY/translateX for positioning (not top/left)data-index on items when using measureElementitem.key as React key (not item.index)scrollMargin for window virtualizers when content precedes the listNever:
height on dynamically measured itemsoverflow: auto on scroll containersmooth scroll behavior with dynamic-size items (documented limitation)| Option | Default | Purpose |
|---|---|---|
overscan | 1 | Extra items rendered outside visible area |
gap | 0 | Spacing between items (px) — use instead of CSS margin |
paddingStart | 0 | Padding before first item (px) |
paddingEnd | 0 | Padding after last item (px) |
horizontal | false | Horizontal orientation |
lanes | 1 | Columns (vertical) or rows (horizontal) for masonry |
getItemKey | index | Stable item keys — always set when items have IDs |
enabled | true | Set false to disable observers and reset state |
isRtl | false | RTL horizontal scroll |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.