Skip to content

CardGrid

Rows of an action shown as cards.

Example

Products

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()
}