# ✨Yew-InfiniteFor.rs✨ [中文](https://github.com/1216892614/Yew-InfiniteFor.rs/blob/main/README-zh.md) `Yew-InfiniteFor.rs` is a list component that scrolls infinitely for Yew. # 🔥What's the highlight🔥 - It support function_component style! - It can smart change how many items render in once by view size. - It support row mode and column mode. - And, it's easy to use! # 📑How to use it?📑 Just 3 Simple steps, do like this: 1. Get `Yew-Canvas.rs`! ```toml #Cargo.toml [dependencies] yew="0.19" yew-infinite-list="..." ``` 1. Create a `request` Callback in the function_component! ```rust // This callback accept a Two-tuple: // - n: usize: the serial number of the item // - ret: Callback: Html setter of the item let request = Callback::from(|(n, ret): (usize, Callback)| { gloo::console::log!("Tag ", n, " rendered!"); ret.emit(html!(

{format!("This is tag {n}")}

)) }); ``` 1. Return the component as `InfiniteFor`! ```rust html! {
// children is the load sign // at the bottom of the page

{ "This is the end of page\n这里是页面底部" }

} ``` # 👌Run Exmple👌 0. This requires you to set up the `Yew.rs` development environment in advance, the following is a `Trunk` packaging example: 1. `cd ./examples/base-use` 2. `trunk server` # ⚖️License⚖️ `Yew-InfiniteFor.rs` is dual licensed under the MIT license and the Apache License (Version 2.0).