Contents
Garden HandbookComponent referencegarden stat

Component reference · stat

Display 2 to 4 key numbers, units, and short captions side by side.

← Component reference · Usage: stat

1Examples

Code

```garden stat
items:
  - label: Reading Column
    value: "740"
    unit: px
    caption: Default prose column width
  - label: Wide Figure Limit
    value: "1040"
    unit: px
    caption: Extends up to 150px on each side
  - label: Wide Table Limit
    value: "1340"
    unit: px
    caption: Extends up to 300px on each side
```

Preview

Reading Column
740px
Default prose column width
Wide Figure Limit
1040px
Extends up to 150px on each side
Wide Table Limit
1340px
Extends up to 300px on each side

2Syntax

```garden stat
items:        # for several, 2–4 suggested
  - label:    # required, label
    value:    # required, number
    unit:     # optional, unit
    caption:  # optional, short note
    text:     # optional, extra text
    source:   # optional, source URL
```

3Fields

Fence header: ```garden stat (snippet trigger ;gstat). Place multiple figures in items, or place fields at the top level for a single figure; invalid YAML or unknown top-level keys report garden-yaml on the block.

FieldRequiredDefaultAllowed Values & LimitsDescription
itemsRequired for multiple figures[top-level object]object[] (2 to 4 items recommended, not checked)List of stat items displayed side by side; when omitted, top-level fields render as a single stat item
labelRequired""stringMetric name shown above the number
valueRequired""string or numberPrimary figure rendered in large tabular type
unitOptionalnonestringUnit shown immediately to the right of value
captionOptionalnonestringShort note below the figure
textOptionalnonestringAdditional explanatory text
sourceOptionalnoneURL, { url, site?, icon? }, or arraySource attribution chip (site defaults to the URL hostname without www.)

4Limits & errors

  • Apart from the shared garden-yaml, this component has no error codes of its own; values marked "not checked" in the table never report an error.
Contents