HOC SiteDocumentation

Simple text

Decoration and visibility use Decoration & visibility (BlockShell).

Single-style text (plain or heading). Omit level for a paragraph; set h1–h6 only when you need semantic heading hierarchy. Multiline is fine. For mixed rich formatting, use RichTextBlock. Set responsive type with Authored typography.size ([{ if, is }], including { bp } conditions). Optional typography.lineHeight (px) paints --heading-line-height; unset inherits. Shell shell.box.size sizes the box, not the type.

Examples

Plain label

{
  "content": {
    "text": [
      {
        "if": "*",
        "is": "Browse categories"
      }
    ]
  },
  "typography": {
    "size": [
      {
        "if": "*",
        "is": 18
      }
    ],
    "weight": [
      {
        "if": "*",
        "is": 500
      }
    ]
  }
}

Section heading

{
  "content": {
    "text": [
      {
        "if": "*",
        "is": "Latest threads"
      }
    ]
  },
  "typography": {
    "level": [
      {
        "if": "*",
        "is": "h2"
      }
    ],
    "size": [
      {
        "if": "*",
        "is": 28
      }
    ]
  }
}

Fields

content

text

Plain text content. Newlines are preserved; the whole string shares one style. Mix in {{icon:iconId}} chips the same way as ButtonBlock; the icon picker appends a chip at the end. An older icon prop still renders, and is folded into a leading chip when the block is edited. Plural/select forms: {{plural:lists.cartLines.aggregates.count|=0{Your cart is empty} one{# item in your cart} other{# items in your cart}}} (and {{select:…}}); each locale authors its own branches.

content: {
  text: [{ if: "*", is: "{{plural:lists.cartLines.aggregates.count|=0{Your cart is empty} one{# item in your cart} other{# items in your cart}}}" }]
}

icon

Leading icon id. Prefer {{icon:…}} chips in text. Still rendered when no icon chip is present.

icon: [{ if: "*", is: "arrow-right" }]

textPaint

Text Paint.

typography

align

Horizontal text alignment (typography.align). On a heading, an explicit left is stored and pulls the block to the start of a centered flex parent. Omitting it keeps the parent alignment. Also used as FlexList/Row cross-axis alignment (layout.align).

Options: left, center, right

typography: {
  align: [{ if: "*", is: "center" }]
}

size

Font size in px as an Authored [{ if, is }] leaf (use { bp } for per-breakpoint values). Media CSS owns --heading-font-size when the leaf includes breakpoint conditions.

typography: {
  size: [{ if: [{ bp: "mobile" }], is: 36 }, { if: "*", is: 48 }]
}

lineHeight

Line-height in px. Unset inherits from theme/parent; paints --heading-line-height on the text.

typography: {
  lineHeight: [{ if: "*", is: 24 }]
}

letterSpacing

Letter-spacing in px (negative allowed). Helps long words fit without mid-word breaks; overflow wrap is normal (word boundaries).

typography: {
  letterSpacing: [{ if: "*", is: -0.9 }]
}

textTransform

Text Transform.

weight

Numeric font weight (typography.weight / CSS font-weight).

typography: {
  weight: [{ if: "*", is: 600 }]
}

family

Font family (typography.family). A theme token (theme-heading, theme-body, theme-mono), a rich-text font id, a CSS generic family (sans-serif, serif, monospace, system-ui, ui-sans-serif, cursive, fantasy), or a comma-separated stack.

typography: {
  family: [{ if: "*", is: "theme-heading" }]
}

italic

When true, renders the text in italic style.

typography: {
  italic: [{ if: "*", is: false }]
}

underline

When true, renders an underline on the text.

typography: {
  underline: [{ if: "*", is: false }]
}

level

Optional semantic heading level. When omitted, the block renders as a paragraph (<p>).

Leave unset for ordinary body/label text. Set h1–h6 only when the text is a document heading. Prefer one H1 per page topic; use H2/H3 for sections. A clear heading hierarchy helps visitors, screen readers, search engines, and AI agents.

Options: h1, h2, h3, h4, h5, h6

typography: {
  level: [{ if: "*", is: "h2" }]
}

appearance

color

textColor

Foreground text color. One authored color leaf: * is light, { theme: "dark" } is dark, and { on } (hover, active, focus, selected) is the interaction.

textColor: [
  { if: [{ theme: "dark" }], is: "#f9fafb" },
  { if: "*", is: "#111827" }
]

decoration

decorationEnabled

Toggles an underline or accent decoration under the text.

decorationEnabled: [{ if: "*", is: true }]
decorationWidth

Unit: px

Width of the text decoration line in pixels.

appearance: {
  decoration: {
    decorationWidth: [{ if: "*", is: 96 }]
  }
}
decorationThickness

Unit: px

Stroke thickness of the text decoration in pixels.

appearance: {
  decoration: {
    decorationThickness: [{ if: "*", is: 8 }]
  }
}
decorationSpacing

Unit: px

Gap between the text and its decoration in pixels.

appearance: {
  decoration: {
    decorationSpacing: [{ if: "*", is: 12 }]
  }
}
decorationColor

Underline or accent decoration color. One authored color leaf: * is light, { theme: "dark" } is dark, and { on } (hover, active, focus, selected) is the interaction.

appearance: {
  decoration: {
    decorationColor: [
      { if: [{ theme: "dark" }], is: "#60a5fa" },
      { if: "*", is: "#2563eb" }
    ]
  }
}
underlineMode

Underline rendering mode for decorated text. inline | separate (option catalog underline-mode).

Options: inline, separate

appearance: {
  decoration: {
    underlineMode: [{ if: "*", is: "inline" }]
  }
}

textShadow

textShadowEnabled

Enables a drop shadow behind the text.

textShadowEnabled: [{ if: "*", is: false }]
textShadowOffsetX

Unit: px

Horizontal offset of the text shadow in pixels.

appearance: {
  textShadow: {
    textShadowOffsetX: [{ if: "*", is: 3 }]
  }
}
textShadowOffsetY

Unit: px

Vertical offset of the text shadow in pixels.

appearance: {
  textShadow: {
    textShadowOffsetY: [{ if: "*", is: 3 }]
  }
}
textShadowBlur

Unit: px

Blur radius of the text shadow in pixels.

appearance: {
  textShadow: {
    textShadowBlur: [{ if: "*", is: 0 }]
  }
}
textShadowColor

Text shadow color. One authored color leaf: * is light, { theme: "dark" } is dark, and { on } (hover, active, focus, selected) is the interaction.

appearance: {
  textShadow: {
    textShadowColor: [
      { if: [{ theme: "dark" }], is: "rgba(0, 0, 0, 0.75)" },
      { if: "*", is: "rgba(0, 0, 0, 0.55)" }
    ]
  }
}

Default props

{
  "icon": [
    {
      "if": "*",
      "is": "none"
    }
  ],
  "shell": {
    "visibility": [
      {
        "if": "*",
        "is": true
      }
    ],
    "anchor": {
      "anchorId": [
        {
          "if": "*",
          "is": ""
        }
      ],
      "anchorKey": [
        {
          "if": "*",
          "is": ""
        }
      ]
    },
    "pointerEvents": [
      {
        "if": "*",
        "is": "auto"
      }
    ]
  },
  "content": {
    "text": [
      {
        "if": "*",
        "is": ""
      }
    ]
  },
  "typography": {
    "align": [
      {
        "if": "*",
        "is": "left"
      }
    ],
    "size": [
      {
        "if": "*",
        "is": 48
      }
    ],
    "weight": [
      {
        "if": "*",
        "is": 600
      }
    ],
    "family": [
      {
        "if": "*",
        "is": "theme-heading"
      }
    ],
    "italic": [
      {
        "if": "*",
        "is": false
      }
    ],
    "underline": [
      {
        "if": "*",
        "is": false
      }
    ]
  },
  "appearance": {
    "color": {
      "text": [
        {
          "if": "*",
          "is": ""
        }
      ]
    },
    "decoration": {
      "enabled": [
        {
          "if": "*",
          "is": false
        }
      ],
      "decorationWidth": [
        {
          "if": "*",
          "is": 96
        }
      ],
      "decorationThickness": [
        {
          "if": "*",
          "is": 8
        }
      ],
      "decorationSpacing": [
        {
          "if": "*",
          "is": 12
        }
      ],
      "decorationColor": [
        {
          "if": "*",
          "is": ""
        }
      ],
      "underlineMode": [
        {
          "if": "*",
          "is": "inline"
        }
      ]
    },
    "textShadow": {
      "enabled": [
        {
          "if": "*",
          "is": false
        }
      ],
      "textShadowOffsetX": [
        {
          "if": "*",
          "is": 3
        }
      ],
      "textShadowOffsetY": [
        {
          "if": "*",
          "is": 3
        }
      ],
      "textShadowBlur": [
        {
          "if": "*",
          "is": 0
        }
      ],
      "textShadowColor": [
        {
          "if": [
            {
              "theme": "dark"
            }
          ],
          "is": "rgba(0, 0, 0, 0.7)"
        },
        {
          "if": "*",
          "is": "rgba(0, 0, 0, 0.55)"
        }
      ]
    }
  }
}