Card::new( Element::column(vec![ card_copy(cx, "Proposed plan", "A card without a width uses the space it receives; the host supplies its content, including actions."), row(vec![Button::new("blocks-card-build", "Build", palette) .variant(ButtonVariant::Outline) .render()]), ]) .gap(10.0), palette,).density(CardDensity::Roomy).render().size(Some(width), None)
Card
A raised surface that sets one group of content into the page. The host
builds the content; the card adds the padding, the hairline and the corners.
Import
use limn::{Card, CardDensity, Component, RadiusRole};
Usage
A card takes its content and the palette. It fills with the palette’s
raised under a 1 px hairline of its border, and its height follows the
content. It is passive: it reports nothing.
density sets the padding around the content: 8 px for Compact, 10 for
Regular, which is the default, and 12 for Roomy. Flush pads nothing,
for content whose rows run to the card’s edge and bring their own inset.