molecules
Stats
A definition list of key and value pairs. Rows with an empty value are skipped, and callers colour the terms and values through slots.
Specimens
{{ Stats.render({
aria: "Project metadata",
stats: [
{ key: "Client", value: "Ford Motor Company" },
{ key: "Role", value: "Creative technologist" },
{ key: "Year", value: "2019" },
{ key: "Skipped", value: "" }
],
classes: { base: "grid gap-4", sm: "grid-cols-3" },
styles: {
term: "text-sm uppercase tracking-wider text-neutral-400",
value: "text-lg text-neutral-100"
}
}) }}{{ Stats.render({
stats: [
{ key: "Awards", value: "12" },
{ key: "Organizations", value: "9" }
],
classes: "flex gap-8",
styles: {
term: "text-sm text-neutral-600",
value: "font-display text-4xl text-neutral-900"
}
}) }}Params
| Param | Type | Description |
|---|---|---|
stats | array | Array of { key, value, description }; items with an empty value are skipped. description is optional and renders as a second <dd>. |
classes | string | variant map | array | The <dl> root (string, variant map, or array). |
styles | object | Slots { item, term, value, description }. item is appended to the <div> baseline. term, value and description are the only classes on the <dt> and the two <dd>s. They carry no baked-in colour, so callers set it (card.njk passes term: "text-neutral-300", project.njk passes text-neutral-400). |
aria | string | aria-label for the <dl>; defaults to "Metadata". |