Skip to main content

Module card

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. 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.
CardFace
Immediate-mode card: the surface, leading stripe, title and focus ring of a Card, for a caller that paints its own body into CardFace::body_rect.
CardGrid
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.

Enums§

CardWidth
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 cols columns that, with gap between them, fill avail_w exactly. Never negative.
card_columns
How many columns of at least min_card_w fit in avail_w with gap between them. Always at least 1.