Interactive example
The Tailwind demo runs vertical and horizontal virtual lists with live stats, gap and padding, and integration-oriented copy you can adapt in your own app.
Open Tailwind example →Public API
High-level entry points for apps and for headless use without Yew markup.
| Symbol | Role |
|---|---|
Virtualizer |
Core engine: range math, overscan, scroll alignment, measurements |
VirtualizerOptions |
Item count, size mode, direction, gap, padding, overscan, RTL |
use_virtualizer |
Hook: scroll container ref, passive scroll listener, resize observer |
use_window_virtualizer |
Hook: document / window scroll with the same engine |
VirtualizerHandle |
Read virtual items, total size, scroll helpers, item observers |
Features
- Headless core — you own markup, layout, and styling
- Vertical and horizontal scrolling, including RTL horizontal offsets
- Fixed, estimated, and dynamic item sizing with optional measurement
- Overscan, gap, padding, and scroll-margin style options
- Scroll to index with Start, Center, End, and Auto alignment
- Yew hooks with passive scroll listeners and container resize observation
- Safe Rust — no
unsafe, nounwrap()orexpect()in the library
Installation
Add to your Cargo.toml (crates.io or path as needed):
[dependencies]
yew = { version = "0.21", features = ["csr"] }
yew-virtual = "0.1"
Turn on yew’s csr (or ssr / hydration per Yew’s docs); this crate
does not ship separate csr / ssr features.