dioxus-lazy

Crates.iodioxus-lazy
lib.rsdioxus-lazy
version0.3.0-alpha.3
sourcesrc
created_at2024-06-04 22:04:59.229349
updated_at2024-10-27 21:36:23.669065
descriptionAsync list components for Dioxus
homepage
repositoryhttps://github.com/dioxus-community/dioxus-lazy
max_upload_size
id1262135
size96,236
Marc Espin (marc2332)

documentation

README

Dioxus-lazy

License Crates.io Docs CI

Virtualized components for dioxus

use dioxus::prelude::*;
use dioxus_lazy::{lazy, List};

fn app() -> Element {
    rsx! {
        List {
            len: 100,
            size: 400.,
            item_size: 20.,
            make_item: move |idx: &usize| rsx!("Item {*idx}"),
            make_value: lazy::from_fn(|idx| { idx })
        }

        // Or with async!

        List {
            len: 100,
            size: 400.,
            item_size: 20.,
            make_item: move |idx: &usize| rsx!("Async item {*idx}"),
            make_value: lazy::from_async_fn(|idx| async move { idx })
        }
    }
}
use dioxus::prelude::*;
use dioxus_lazy::{factory, Direction, UseList};

fn app() -> Element {
    let list = UseList::builder()
        .direction(Direction::Row)
        .size(500.)
        .use_list(cx, factory::from_fn(|idx| async move { idx }));

    rsx!(div {
        onmounted: move |event| list.mounted.onmounted(event)
    })
}
Commit count: 42

cargo fmt