Skip to content
Elements / Content

tile

A small fixed-size face with a value, an optional icon and a detail line, for playing cards, seats, dice, keys or lottery numbers. Several in a row keep their size and wrap.

Spec · edit me

No problems. The parser accepted every line.

Result · try itOpen in playground
Tweak the props
shape
size
tone
variant

Props

"text"textThe value on its face, e.g. A, 10 or B4. Keep it short.optional
iconstringAn icon on its face, by name from icon's list, e.g. icon=club. The suits are club, spade, heart and diamond.—
shapecard · squarecard (portrait, like a playing card) or square (a seat, a key, a die).card
sizesm · md · lgsm, md or lg.md
detailstringA small line under the value, e.g. a price or an atomic weight. Keep it to a few characters at size=sm.—
tonedefault · muted · accent · good · warn · badColor of the value and icon: default, muted, accent, good, warn or bad (red suits use bad).default
variantraised · outlineraised (a lifted face) or outline.raised
selectedconditionExpression; when true the tile is marked as chosen, e.g. selected={s.picked}.—
disabledconditionExpression; when true it's greyed out and can't be pressed, e.g. a seat that's taken.—
onactionActions to run when pressed, e.g. emit:changed. Separate several with ;—
labelstringWhat screen readers and Copy text say for it, e.g. label="Seat B4". Default: its value (with its suit, as in Q of hearts) and detail.—
ifconditionShow only when this expression is true, e.g. if=done or if={count>0}. Every element takes it.—
tipstringA short explanation shown on hover, keyboard focus or a tap, e.g. tip="Orders not yet shipped": for a term or a number some people won't know, instead of more words on screen. It makes the element a Tab stop if it isn't one. Every element takes it.—

SayShape v0.1 is an early prototype under the MIT License. Status · GitHub