Skip to main content

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

Project metadata The terms and values carry no colour of their own, so the caller sets it, as project pages do.
Client
Ford Motor Company
Role
Creative technologist
Year
2019
{{ 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"
  }
}) }}
On paper
Awards
12
Organizations
9
{{ 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

ParamTypeDescription
statsarrayArray of { key, value, description }; items with an empty value are skipped. description is optional and renders as a second <dd>.
classesstring | variant map | arrayThe <dl> root (string, variant map, or array).
stylesobjectSlots { 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).
ariastringaria-label for the <dl>; defaults to "Metadata".