Contents
Garden HandbookComponent referencegarden figure

Component reference · figure

Deprecated. Old garden figure fields stay documented here. New diagrams use compose.

← Component reference · Usage: figure

1Deprecated

New diagrams use compose. This page only records the old fields. Do not write a new garden figure.

2Syntax

```garden figure
svg: |      # one of three, inline SVG
image:      # one of three, image path
mermaid: |  # one of three, Mermaid
alt:        # optional, alt text
parts:      # optional, buttons
  - id:     # matches data-p
    label:  # required, button (or name)
    text:   # required, description
caption:    # optional, caption
```

3Fields

Fence header: ```garden figure (snippet trigger ;gfigure). Invalid YAML or unknown top-level keys report garden-yaml on the block.

FieldRequiredDefaultAllowed Values & LimitsDescription
svgOne of svg, image, or mermaid<svg> body below --- or ""multiline <svg> stringInline SVG markup; tag elements to highlight with data-p="<id>" (use CSS variables such as var(--card), var(--ink), and var(--muted) so dark mode works)
imageOne of image, svg, or mermaidnonepath stringPath to a static diagram image
altOptionalcaption (then "")stringAlt text for image
mermaidOne of mermaid, svg, or imagenonemultiline stringMermaid diagram source
partsOptional[] (initial selection defaults to parts[0].id or "all")object[]Interactive buttons above the diagram and matching explanations below
parts[].idRecommendedparts[].name or parts[].labelstringMatches data-p on SVG elements (an id of "all" highlights every region)
parts[].labelRequired (or name)"Part N" (1-based)stringButton label
parts[].textRequired""stringExplanation shown below the diagram when the button is active
captionOptionalnonestringCaption below the frame

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