item cards
cards that fill the available width, small or the full measure. a title can link the whole card while an action stays a separate control.
bunx --bun shadcn@latest add @mk/item-cardsserves trisys, orbit, artifacts, the public site.
example
the first draft has media and a save control. its title links below; the next card has neither media nor a link. the last links without media.
link states
the title appears once and names the stretched link. focus stays inside the card, and its corner control keeps its own ring.
rest
the card keeps its flat surface
hover
the card keeps its flat surface
focus
the ring follows the whole card
rest
the card keeps its flat surface
hover
the card keeps its flat surface
focus
the ring follows the whole card
on a phone
the grid uses one column when only one card fits. a narrow viewport leaves the title and corner action room to work.
full width
variant="full" takes the whole measure, for a queue someone works down: a title, when it matters, why it’s here, and a foot with who it goes to. the card is one link. an action sits above it, so reject never opens the card. a time the reader has to meet takes clock, which prints in foreground; an age stays muted.
a linked card answers the pointer on its edge and its title. focus takes the whole card.
hover
the edge lifts and the title underlines
focus
the ring outlines the whole card, 2 px outside its edge
hover
the edge lifts and the title underlines
focus
the ring outlines the whole card, 2 px outside its edge
decided
variant="decided" collapses a card to one line: the title, the word it was decided with, and the date. the same parts print, so a card moves from one form to the other by its variant alone. a long title ellipsizes, and the lede and actions don’t print. at 600 px and below the line can’t hold all three, so it folds to two in a 56 px row: the title, then the word and the date.
a row answers the pointer on its title. its ring stays inside its rules, and the row’s padding keeps it off the words.
hover
the title underlines
focus
the ring stays inside the row and clear of its words
hover
the title underlines
focus
the ring stays inside the row and clear of its words
in the panel
inside the working panel a list of decided rows reaches the panel’s edges, so its rules do. a list that mixes the two forms keeps its measure, so a card changing form never widens the others. these frames use an 880 px viewport.
on a phone a full list reaches them too: its cards give up their boxes for ruled rows. last says nothing follows the list in the panel, so it runs down to the panel’s foot and drops its closing rule. these frames use a 390 px viewport.
tiles
tiles on the list makes it a full-bleed grid of ruled cells, for the things a person holds, such as the sources an app reads. the grid hangs from one rule in foreground, and each tile prints a 96 px mark, a name, what it holds and, when it needs someone, its state and one action. four columns from 832 px of list, three from 624 px, two below. the last tile closes a short row. these frames hold the panel at its full 880 px.
paper on a card makes it the one tile that prints on paper: the tile that needs the reader. it comes first, so its contact edge lands on the grid, and it keeps its fill under the pointer. a linked tile takes the faint fill and its mark’s second frame. the action sits level with the state in a 220 px cell and takes its own line anywhere narrower. on a phone the mark drops to 80 px and the action stretches to a 44 px target. these frames use a 390 px viewport.
parts
ItemCards- the list.
ItemCardis one card, and itsvariantsets the form every part prints in. setlastwhen nothing follows the list in the working panel, andtilesfor the grid of ruled cells, wherepaperon oneItemCardprints that tile on paper. ItemCardTitle- links the whole card with
hreforrender. a full card’s title and a tile’s are headings: setlevelunder a section’s title. ItemCardWhen- a time or an age, in mono.
clockmarks a time to meet. ItemCardLede- why a full card is here, in reading type, or what a tile holds, at the instrument step. no other card prints it.
ItemCardMeta- a small card’s bottom line. on a full card it takes pieces, one to an element or a run of text, and prints the dot between them, with the first in foreground. on a decided card it’s the one word, and on a tile the state.
ItemCardActions- the app’s buttons: the corner of a small card, the foot of a full card, a tile’s one action, nothing when decided.
ItemCardMedia- a small card’s thumbnail, or a tile’s mark, usually a
SourceMark.ItemCardIdis the small card’s quiet id line.