[{"data":1,"prerenderedAt":338},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-introduction":107,"-getting-started-introduction-surround":335},[4,26,57,87,97],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":25},"Getting Started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-book-open",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F3.architecture","i-lucide-workflow",false,{"title":27,"icon":28,"path":29,"stem":30,"children":31,"page":25},"Reference","i-lucide-layers","\u002Freference","2.reference",[32,37,42,47,52],{"title":33,"path":34,"stem":35,"icon":36},"VirtualGrid","\u002Freference\u002Fvirtual-grid","2.reference\u002F1.virtual-grid","i-lucide-table-2",{"title":38,"path":39,"stem":40,"icon":41},"Primitives","\u002Freference\u002Fprimitives","2.reference\u002F2.primitives","i-lucide-crosshair",{"title":43,"path":44,"stem":45,"icon":46},"Utilities","\u002Freference\u002Futilities","2.reference\u002F3.utilities","i-lucide-wrench",{"title":48,"path":49,"stem":50,"icon":51},"Benchmarks","\u002Freference\u002Fbenchmarks","2.reference\u002F4.benchmarks","i-lucide-timer",{"title":53,"path":54,"stem":55,"icon":56},"ARIA patterns","\u002Freference\u002Faria-patterns","2.reference\u002F6.aria-patterns","i-lucide-accessibility",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":25},"Guides","i-lucide-compass","\u002Fguides","3.guides",[63,67,72,77,82],{"title":64,"path":65,"stem":66,"icon":56},"Accessibility","\u002Fguides\u002Faccessibility","3.guides\u002F1.accessibility",{"title":68,"path":69,"stem":70,"icon":71},"Popovers and overlays","\u002Fguides\u002Fpopovers","3.guides\u002F2.popovers","i-lucide-message-square",{"title":73,"path":74,"stem":75,"icon":76},"Floating UI","\u002Fguides\u002Ffloating-ui","3.guides\u002F3.floating-ui","i-lucide-layers-2",{"title":78,"path":79,"stem":80,"icon":81},"Sizing and direction","\u002Fguides\u002Fsizing-and-direction","3.guides\u002F4.sizing-and-direction","i-lucide-move",{"title":83,"path":84,"stem":85,"icon":86},"Performance","\u002Fguides\u002Fperformance","3.guides\u002F5.performance","i-lucide-gauge",{"title":88,"icon":89,"path":90,"stem":91,"children":92,"page":25},"Examples","i-lucide-flask-conical","\u002Fexamples","4.examples",[93],{"title":94,"path":95,"stem":96,"icon":56},"ARIA examples","\u002Fexamples\u002Faria","4.examples\u002F1.aria",{"title":98,"icon":99,"path":100,"stem":101,"children":102,"page":25},"Changes","i-lucide-history","\u002Fchanges","5.changes",[103],{"title":104,"path":105,"stem":106,"icon":99},"Changelog","\u002Fchanges\u002Fchangelog","5.changes\u002F1.changelog",{"id":108,"title":11,"body":109,"description":328,"extension":329,"links":330,"meta":331,"navigation":332,"path":12,"seo":333,"stem":13,"__hash__":334},"docs\u002F1.getting-started\u002F1.introduction.md",{"type":110,"value":111,"toc":320},"minimark",[112,121,124,127,130,136,141,172,176,188,245,248,277,281,287,293,297],[113,114,115,116,120],"p",{},"A page that renders 1,000,000 items as DOM elements creates 1,000,000 elements, and the browser lays out every one before the page is usable. ",[117,118,119],"code",{},"vvirtual-grid"," is a Vue 3 component that avoids this. It lays the list out as a CSS grid and keeps only the items near the viewport in the page.",[113,122,123],{},"A list of 1,000,000 items keeps about the same few hundred elements as a list of 1,000.",[125,126],"grid-demo",{},[113,128,129],{},"Scroll the grid. The element count in the demo stays flat while the item numbers climb toward 999,999.",[131,132,133,135],"note",{},[117,134,119],{}," requires Vue 3.5 or later. Nuxt 3 and 4 work through the included module.",[137,138,140],"h2",{"id":139},"what-the-package-contains","What the package contains",[142,143,144,154,162],"ul",{},[145,146,147,153],"li",{},[148,149,150],"a",{"href":34},[117,151,152],{},"\u003CVirtualGrid>"," is the component. You give it the number of items and a function that returns a page of them.",[145,155,156,161],{},[148,157,158],{"href":44},[117,159,160],{},"createPageProvider"," wraps an array in memory in that function, so you can start without a server.",[145,163,164,167,168,171],{},[148,165,166],{"href":39},"The primitives"," in ",[117,169,170],{},"vvirtual-grid\u002Fprimitives"," compute where an item is, even when it is not in the page. You use them for accessibility, focus and popovers.",[137,173,175],{"id":174},"when-to-use-tanstack-virtual-instead","When to use TanStack Virtual instead",[113,177,178,180,181,187],{},[117,179,119],{}," does four things that a general-purpose virtualizer leaves to you. If your project needs none of them, use ",[148,182,186],{"href":183,"rel":184},"https:\u002F\u002Ftanstack.com\u002Fvirtual",[185],"nofollow","TanStack Virtual",".",[142,189,190,201,223,239],{},[145,191,192,196,197,200],{},[193,194,195],"strong",{},"It loads the data in pages."," You pass a ",[117,198,199],{},"pageProvider"," function. The grid calls it for each page that scrolls into view, remembers the result, and renders a placeholder until the page arrives. With TanStack Virtual, you write the loading, the cache and the placeholders.",[145,202,203,206,207,210,211,214,215,218,219,222],{},[193,204,205],{},"It reads the layout from your CSS."," The grid takes its columns, gaps and flow from the ",[117,208,209],{},"grid-template-columns",", ",[117,212,213],{},"gap"," and ",[117,216,217],{},"grid-auto-flow"," you set on it. A ",[117,220,221],{},"repeat(auto-fill, minmax(200px, 1fr))"," grid changes its column count with the viewport, with no code. With TanStack Virtual, you compute the column count in JavaScript, and again after every resize.",[145,224,225,228,229,232,233,236,237,187],{},[193,226,227],{},"It renders each item as a direct child of one grid element."," There are no row wrappers, so ",[117,230,231],{},"role=\"list\""," on the grid and ",[117,234,235],{},"role=\"listitem\""," on the items describe the markup as it is. See ",[148,238,64],{"href":65},[145,240,241,244],{},[193,242,243],{},"It renders the first page on the server."," The HTML holds the first items before any script has measured the page.",[113,246,247],{},"TanStack Virtual is the better choice in three cases.",[142,249,250,259,268],{},[145,251,252,255,256,258],{},[193,253,254],{},"Your items differ in size."," Every item in ",[117,257,119],{}," has the size of the probe. TanStack Virtual measures each item.",[145,260,261,264,265,267],{},[193,262,263],{},"You render a list, a table or a masonry layout."," ",[117,266,119],{}," renders grids only.",[145,269,270,273,274,276],{},[193,271,272],{},"Bundle size and the first render matter most."," In our test of 1,000,000 items in 10 columns, TanStack Virtual adds 9.8 KB of gzipped JavaScript and shows its first items 23.5 ms after mount. ",[117,275,119],{}," adds 13.8 KB and takes 63.2 ms, because it measures the probe and requests the first page before it places items.",[137,278,280],{"id":279},"how-the-grid-decides-what-to-render","How the grid decides what to render",[113,282,283,284,187],{},"The grid measures one hidden element, called the probe, to learn the size of an item. It combines that size with how far you have scrolled to work out which items are on screen. It renders those items plus a buffer of extra items above and below, asks your function for the pages it needs, and places each item with a CSS ",[117,285,286],{},"transform",[113,288,289,290,292],{},"The ",[148,291,21],{"href":22}," page follows this step by step, from the props to the DOM.",[137,294,296],{"id":295},"next-steps","Next steps",[142,298,299,304,309,314],{},[145,300,301,303],{},[148,302,16],{"href":17}," adds the package to a Vue or Nuxt project and renders a first grid.",[145,305,306,308],{},[148,307,21],{"href":22}," explains the internals for contributors and advanced users.",[145,310,311,313],{},[148,312,64],{"href":65}," makes a screen reader announce item positions.",[145,315,316,319],{},[148,317,318],{"href":69},"Popovers"," anchors an element to an item.",{"title":321,"searchDepth":322,"depth":322,"links":323},"",2,[324,325,326,327],{"id":139,"depth":322,"text":140},{"id":174,"depth":322,"text":175},{"id":279,"depth":322,"text":280},{"id":295,"depth":322,"text":296},"What vvirtual-grid is, what problem it solves, and what it gives you.","md",null,{},{"icon":14},{"title":11,"description":328},"hb1aFpEpRzUpaC_VksDUmt2k1mf_yIdE8zPp3updRHw",[330,336],{"title":16,"path":17,"stem":18,"description":337,"icon":19,"children":-1},"Add vvirtual-grid to a Vue or Nuxt project and render a first grid.",1794785667993]