-
-
Notifications
You must be signed in to change notification settings - Fork 15
Virtualized List
github-actions[bot] edited this page Apr 5, 2026
·
1 revision
The virtual_list widget efficiently renders large datasets by only creating elements for a window of visible items. Items can have variable heights — flexbox layout determines their size.
use blinc_layout::widgets::virtual_list::virtual_list;
let items: Vec<String> = (0..10_000)
.map(|i| format!("Item {}", i))
.collect();
virtual_list(items.len(), move |index| {
div()
.w_full()
.p_px(8.0)
.flex_row()
.items_center()
.child(text(&items[index]).size(14.0).color(Color::WHITE))
})
.w_full()
.h(400.0)
.into_div()Items don't need a fixed height. Flexbox handles sizing:
virtual_list(messages.len(), move |i| {
let msg = &messages[i];
div()
.w_full()
.p_px(12.0)
.flex_col()
.gap_px(4.0)
.child(text(&msg.author).size(12.0).bold().color(Color::WHITE))
.child(text(&msg.body).size(14.0).color(Color::rgba(0.8, 0.8, 0.8, 1.0)))
// Height is determined by content — short messages are small, long ones wrap
})
.w_full()
.h(600.0)
.into_div()virtual_list(count, builder)
.w_full() // Width
.h(400.0) // Viewport height
.bg(Color::BLACK) // Background
.rounded(8.0) // Corner radius
.gap_px(4.0) // Gap between items
.estimated_item_height(48.0) // Hint for scroll spacer (default: 40px)
.window_size(80) // Items to render at once (default: 50)
.into_div()| Option | Default | Description |
|---|---|---|
estimated_item_height |
40.0 | Average item height estimate for scroll spacer calculation |
window_size |
50 | Number of items rendered at once |
- The builder creates elements for the first
window_sizeitems - Flexbox layout determines each item's actual height
- A spacer div below the rendered items estimates the remaining scroll height
- The scroll container provides momentum physics scrolling
- Items use their natural flex-determined height — no fixed constraints
Getting Started
Mobile Development
Example Gallery
- Example Gallery
- Canvas Element
- Canvas Kit Interactive
- Carousel Demo - Selector API Showcase
- Chrome-Style Tabs
- blinc_cn Components
- Code Element
- Complex SVG
- CSS Debug
- CSS Visual Features
- Layer Effects
- Emoji and HTML Entities
- @flow Shader
- Fluid Surface
- Skeleton animation with glTF +
blinc_canvas_kit. DrawContext::run_gpu_passend-to-end demo.- Image CSS Styling
- Image Layer Test
- Keyframe Animation Canvas
- Markdown Editor
- 3D Mesh Demo — renders the Khronos glTF
DamagedHelmetsample model - Motion Demo
- Music Player Glass Card
- Node-editor demo — pre-wired graph with three node types, typed
- Notch Menu Bar
- Overflow Fade
- Overlay System
- Pointer Query
- Rich Text Element
- Rich Text Editor
- Scroll Container
- Semantic @flow
- Sortable
- Stateful API + Signal-bound modifiers demo.
- End-to-end 3D demo wiring Blinc's SceneKit3D renderer up to
- Unified Styling API
- SVG Animation
- Table Builder
- Tabler Icons
- Minimal text positioning test
- Text Input Widgets
- KHR_texture_transform
- Theme System
- Timeline Animation
- Typography
- Video Player
- Wet Glass
- Windowed Application
Web Development
Core Concepts
- Elements & Layout
- Styling & Materials
- CSS Styling
- Theming
- Event Handling
- State Management
- Element Refs
Animation
Components
Component Library (blinc_cn)
Widgets
- Buttons & Inputs
- Text & Rich Text
- Code Editor
- Scroll Containers
- Virtualized List
- Canvas Drawing
- Images & SVG
- Audio & Video
- Markdown Rendering
Canvas Kit
Advanced
- Routing & Navigation
- Multi-Window
- System Integration
- Element Query API
- Overlay System
- Custom State Machines
- Pointer Query
- Performance Tips
- Flow Shaders
- 3D Rendering
- Custom GPU Passes
- Hot-reload (experimental)
Architecture
Contributing