VirtualList
Renders only visible items from large lists for performance
Item 1
Item 2
Item 3
Item 4
Item 5
Accessibility
- Treat the component as presentational unless it exposes interactive affordances, and label any interactive affordances explicitly.
- Keep heading, reading, and focus order aligned with the surrounding content.
- Only add region semantics when the scrollable surface has a unique, meaningful label.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { VirtualList } from '@dryui/ui';
</script>
<VirtualList>Content</VirtualList> Import options
Root package
ts
import { VirtualList } from '@dryui/ui' Per-component subpath
ts
import { VirtualList } from '@dryui/ui/virtual-list' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
| items | T[] | — | — | ✓ | — |
| itemHeight | number | ((index: number) => number) | — | — | ✓ | — |
| overscan | number | — | 5 | — | — |
| children | Snippet<[{ item: T; index: number; style: string }]> | Content rendered inside the component. | — | ✓ | — |