ImageCard
A card with an image, badges and progress.
Example
NewField notes 101P-001₺91.69
NewGarden trowel 102P-002₺170.88
NewFern 103P-003₺250.07
NewCity atlas 104P-004₺329.26
Nothing to show.
Show code
use crate::data::{Product, search_products};
use zeyn::prelude::*;
pub fn overview(_ctx: &Ctx) -> Node {
CardGrid::of(search_products)
.card(|p: &Product| {
Card::image(p.image.clone(), p.name.clone())
.subtitle(p.code.clone())
.text(p.price.to_string())
.corner(Badge::new("New").tone(Tone::Success))
.progress(p.stock as f32 / 90.0, "In stock")
})
.image_size(300, 300)
.paging(Paging::infinite(4))
.into()
}