CardGrid
Rows of an action shown as cards.
Example
Products
Bamboo 112₺362.78
Bamboo 124₺113.06
Bamboo 136₺463.34
Bamboo 148₺213.62
Bamboo 160₺563.90
Cactus 109₺125.21
Cactus 121₺475.49
Cactus 133₺225.77
Nothing to show.
Show code
use crate::data::{Product, search_products};
use zeyn::prelude::*;
pub fn overview(_ctx: &Ctx) -> Node {
CardGrid::of(search_products)
.title("Products")
.card(|p: &Product| Card::image(p.image.clone(), p.name.clone()).text(p.price.to_string()))
.sort_option("Name", Product::name, false)
.sort_option("Cheapest", Product::price, false)
.image_size(300, 300)
.paging(Paging::infinite(8))
.into()
}