Template Components

Spacer / Separator

A lightweight visual divider and vertical spacing control. Renders as a horizontal rule (solid or dashed) with configurable thickness, color, and surrounding whitespace, or as an invisible spacer block when the line is hidden.

Overview

A Spacer / Separator (spacer_separator) inserts a horizontal dividing line and/or vertical whitespace between other elements in a template. It is the simplest layout utility node - no children, no data binding, no expressions beyond visibleWhen.

It has three modes controlled by the lineStyle property:

ModeDescription
solid (default)A solid horizontal rule drawn the full content width.
dashedA dashed horizontal rule (5pt dash / 4pt gap).
noneNo visible line - pure vertical whitespace only.

Properties

PropertyTypeDefaultDescription
lineStyleselectsolidVisual style of the rule. Options: solid, dashed, none (space only).
lineColorcolortheme.borderColorColor of the rule. Accepts theme tokens such as theme.borderColor or any hex value.
lineWidthnumber0.5Thickness of the rule in points.
spaceAbovenumber8Vertical space (pt) inserted above the rule.
spaceBelownumber8Vertical space (pt) inserted below the rule.

Spacer-only mode

Setting lineStyle: "none" renders an invisible block that consumes spaceAbove + spaceBelow points of vertical space. Use this to:

  • Add breathing room between two sections without drawing a line.
  • Create precise vertical offsets in complex layouts.

Orphan Protection

The renderer automatically hides trailing spacer_separator nodes that become orphaned when the section or container immediately after them is conditionally hidden. This prevents stray divider lines appearing at the bottom of a page or section when their following content is absent.

Tip

You do not need to add visibleWhen expressions to separators that sit directly before conditionally-visible sections - orphan protection handles this automatically.


Conditional Visibility

PropertyPathDescription
Visible Whenexpressions.visibleWhenExpression evaluated at render time. The element is omitted entirely (no space, no line) when falsy.

Examples

Default hairline rule

All defaults - a subtle 0.5pt solid line using the theme border color.

{
  "type": "spacer_separator",
  "props": {
    "lineStyle": "solid",
    "lineColor": "theme.borderColor",
    "lineWidth": 0.5,
    "spaceAbove": 8,
    "spaceBelow": 8
  }
}

Pure vertical spacer (no line)

{
  "type": "spacer_separator",
  "props": {
    "lineStyle": "none",
    "spaceAbove": 16,
    "spaceBelow": 0
  }
}

Dashed section break

{
  "type": "spacer_separator",
  "props": {
    "lineStyle": "dashed",
    "lineColor": "theme.borderColor",
    "lineWidth": 0.5,
    "spaceAbove": 12,
    "spaceBelow": 12
  }
}

Heavy accent rule

{
  "type": "spacer_separator",
  "props": {
    "lineStyle": "solid",
    "lineColor": "theme.primary",
    "lineWidth": 2,
    "spaceAbove": 12,
    "spaceBelow": 12
  }
}

With conditional visibility

{
  "type": "spacer_separator",
  "props": {
    "lineStyle": "dashed",
    "lineColor": "theme.borderColor",
    "lineWidth": 0.5,
    "spaceAbove": 8,
    "spaceBelow": 8
  },
  "expressions": {
    "visibleWhen": "showDivider === true"
  }
}

On this page