Module card
Expand description
Card and CardGrid: objects in content.
A card exists only for an object: something the person can open, move,
share or drag (an app in a store, a document, a review comment, a saved
connection). Settings groups, form sections and statistics are not cards;
they sit on the content ground separated by space (Section,
FormSection, StatTile).
A card has a header (its name in Subheading, with one optional trailing
action), a body, and an optional footer of Actions. A card led by its
art (Card::with_media: a cover, a preview) shows the art first at the
card’s full inner width and the header under it. Its height is its
content’s; in a CardGrid a row is as tall as its tallest card and the
footers line up. A card that opens something is itself pressable
(Card::on_activate) and lifts under the pointer. A leading stripe in a
Tone marks whose or what kind of object it is (a reviewer’s comment, a
failed job).
CardFace paints the same surface, stripe, title and focus ring for a
caller that lays out and paints its own body.
Structs§
- Actions
- Standard actions in declaration/focus order: secondaries, then primary. Unspecified buttons use measured content sizing; explicit sizes remain manual. Each wrapped line aligns to the trailing edge.
- Card
- A retained card. See the module docs.
- Card
Face - Immediate-mode card: the surface, leading stripe, title and focus ring
of a
Card, for a caller that paints its own body intoCardFace::body_rect. - Card
Grid - Reflows its cards into equal, aligned columns by width. Each row is as tall as its tallest card; cards share the row’s height so their footers line up, and a row of short cards stays short.
- Card
Grid Card Props - One card of a grid: a summary of the resource it stands for, which a press opens.
- Card
Grid Props - Cards in equal, aligned columns: the apps of a store, the devices of a network, the paragraphs of a review. Each card is a resource, and pressing one opens it.
- Card
Props - A summary of one thing on a surface of its own: a dashboard’s tile, a resource’s preview. Pressing it opens what it stands for.
- Described
Card Grid - A described card grid: its grid, and the keys of the cards it shows, in order.
Enums§
- Card
Width - How wide a grid’s cards are at least, before the grid drops a column. Measured in lines of body text, so cards widen with the text scale.
Functions§
- card_
column_ width - The width of each of
colscolumns that, withgapbetween them, fillavail_wexactly. Never negative. - card_
columns - How many columns of at least
min_card_wfit inavail_wwithgapbetween them. Always at least 1.