1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
//! Card builder struct — a bordered container styled after shadcn/ui Card. /// A card container: `border bg-card rounded-xl py-4`. /// /// Not a `Widget` — uses `show(ui, closure)` pattern like `egui::Frame`. #[must_use] pub struct Card { pub(crate) heading: Option<String>, } impl Default for Card { fn default() -> Self { Self::new() } } impl Card { pub fn new() -> Self { Self { heading: None } } /// Adds a strong heading rendered above the card content. pub fn heading(mut self, heading: impl Into<String>) -> Self { self.heading = Some(heading.into()); self } }