` with a `` whose `colspan` matches the number of columns in the first visible row.
```html
```
---
## List Virtualization
Standard `` and `` containers work out of the box. Spacer elements are rendered as `- `.
```html
```
---
## Buffer (Overscan)
The `virtual-buffer` attribute controls how many extra items are rendered beyond the visible viewport in each direction. This prevents blank flashes during fast scrolling.
```html
```
---
## Loop Context Variables
Each rendered item receives the same loop context variables as a standard NoJS `each` binding:
| Variable | Type | Description |
|----------|------|-------------|
| `$index` | number | Zero-based index of the item in the full array |
| `$count` | number | Total number of items in the array |
| `$first` | boolean | `true` for the first item |
| `$last` | boolean | `true` for the last item |
| `$even` | boolean | `true` for even-indexed items (0, 2, 4...) |
| `$odd` | boolean | `true` for odd-indexed items (1, 3, 5...) |
```html
```
---
## CSS Classes
| Class / Attribute | Applied to | Description |
|-------------------|-----------|-------------|
| `data-nojs-virtual` | Container element | Marks the container as a virtual list |
| `nojs-virtual-spacer` | Generated spacer elements | Top and bottom spacers that maintain scroll height |
### Built-in Styles
| Selector | Style |
|----------|-------|
| `[data-nojs-virtual]` | `overflow-y: auto; position: relative` |
| `.nojs-virtual-spacer` | `display: block; visibility: hidden; pointer-events: none; margin/padding/border: 0` |
| `table .nojs-virtual-spacer`, `tr.nojs-virtual-spacer` | `display: table-row` (spacer rendered as `` with ``) |
| `dl .nojs-virtual-spacer` | `display: list-item; list-style: none` |
---
## CSS Custom Properties
| Property | Default | Description |
|----------|---------|-------------|
| `--nojs-virtual-list-height` | `auto` | Container height (can be set via CSS instead of inline styles) |
---
## Accessibility
- Spacer elements receive `aria-hidden="true"` so screen readers skip them.
- The container uses native scroll semantics; no ARIA roles are injected on the container itself.
- All rendered items retain their original semantics and ARIA attributes from the template.
---
## Advanced Examples
### Virtualized Definition List
```html
```
### Dynamic Data Updates
The virtual list polls the reactive context for array changes. When items are added, removed, or replaced, the visible range re-renders automatically.
```html
```
### Each Binding
The `each` binding is placed on the child element that serves as the repeating template. This follows the self-repeating loop pattern where the element with `each` IS the template that gets cloned for each item.
```html
```
---
## API Reference
| Attribute | Type | Default | Description |
|-----------|------|---------|-------------|
| `virtual-height` | number \| `"auto"` | `50` | Item height in pixels, or `"auto"` for variable-height rows |
| `virtual-buffer` | number | `5` | Number of overscan items above and below the visible range |
| `each` / `foreach` / `for` | expression | *required* | Loop binding expression (e.g., `item in items`) |
| |