Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Layout Nodes

Layout nodes define the spatial composition of a Voce IR document. There are five layout node types: ViewRoot (the document root), Container (grouping and layout), Surface (visual rectangles), TextNode (styled text), and MediaNode (images, video, audio).

ViewRoot

Top-level container for a document or route. One ViewRoot per page. Defines viewport bounds, document language, and holds the flat semantic node list.

FieldTypeRequiredDescription
node_idstringyesUnique identifier
children[ChildNode]noChild nodes
widthLengthnoViewport width
heightLengthnoViewport height
backgroundColornoDocument background color
document_languagestringnoBCP 47 language tag (e.g., β€œen”)
text_directionTextDirectionnoLtr (default), Rtl, or Auto
semantic_nodes[SemanticNode]noFlat list of semantic nodes referenced by visual nodes
metadataPageMetadatanoPer-page SEO metadata
{
  "node_id": "root",
  "document_language": "en",
  "text_direction": "Ltr",
  "background": { "r": 255, "g": 255, "b": 255, "a": 255 },
  "children": []
}

Container

Groups children with a layout strategy. The primary structural node for composition.

FieldTypeRequiredDescription
node_idstringyesUnique identifier
children[ChildNode]noChild nodes
layoutContainerLayoutnoStack (default), Flex, Grid, or Absolute
directionLayoutDirectionnoRow, Column (default), RowReverse, ColumnReverse
main_alignAlignmentnoMain axis alignment (default Start)
cross_alignAlignmentnoCross axis alignment (default Start)
gapLengthnoGap between children
paddingEdgeInsetsnoInner padding
wrapboolnoEnable flex wrapping (default false)
grid_columns[Length]noColumn track sizes for Grid layout
grid_rows[Length]noRow track sizes for Grid layout
widthLengthnoExplicit width
heightLengthnoExplicit height
min_widthLengthnoMinimum width constraint
max_widthLengthnoMaximum width constraint
min_heightLengthnoMinimum height constraint
max_heightLengthnoMaximum height constraint
overflow_xOverflownoHorizontal overflow (default Visible)
overflow_yOverflownoVertical overflow (default Visible)
clipboolnoClip overflowing content (default false)
positionPositionnoRelative (default), Absolute, Fixed, Sticky
topLengthnoTop offset (for positioned elements)
rightLengthnoRight offset
bottomLengthnoBottom offset
leftLengthnoLeft offset
z_indexint32noStacking order (default 0)
opacityfloat32noOpacity 0.0-1.0 (default 1.0)
backgroundColornoBackground color
borderBorderSidesnoPer-side border configuration
corner_radiusCornerRadiinoPer-corner border radius
shadow[Shadow]noBox shadows
semantic_node_idstringnoReference to a SemanticNode
{
  "node_id": "hero-row",
  "layout": "Flex",
  "direction": "Row",
  "gap": { "value": 16, "unit": "Px" },
  "padding": {
    "top": { "value": 24, "unit": "Px" },
    "right": { "value": 24, "unit": "Px" },
    "bottom": { "value": 24, "unit": "Px" },
    "left": { "value": 24, "unit": "Px" }
  },
  "main_align": "Center",
  "cross_align": "Center",
  "children": []
}

Surface

A visible rectangular region used for cards, backgrounds, dividers, and decorative elements.

FieldTypeRequiredDescription
node_idstringyesUnique identifier
children[ChildNode]noChild nodes
fillColornoFill color
strokeColornoStroke/border color
stroke_widthLengthnoStroke thickness
corner_radiusCornerRadiinoPer-corner border radius
shadow[Shadow]noBox shadows
opacityfloat32noOpacity 0.0-1.0 (default 1.0)
borderBorderSidesnoPer-side border configuration
widthLengthnoExplicit width
heightLengthnoExplicit height
min_widthLengthnoMinimum width constraint
max_widthLengthnoMaximum width constraint
min_heightLengthnoMinimum height constraint
max_heightLengthnoMaximum height constraint
paddingEdgeInsetsnoInner padding
decorativeboolnoIf true, no SemanticNode required (default false)
semantic_node_idstringnoReference to a SemanticNode
{
  "node_id": "card",
  "fill": { "r": 248, "g": 248, "b": 248, "a": 255 },
  "corner_radius": {
    "top_left": { "value": 8, "unit": "Px" },
    "top_right": { "value": 8, "unit": "Px" },
    "bottom_right": { "value": 8, "unit": "Px" },
    "bottom_left": { "value": 8, "unit": "Px" }
  },
  "shadow": [{
    "offset_x": { "value": 0, "unit": "Px" },
    "offset_y": { "value": 2, "unit": "Px" },
    "blur": { "value": 8, "unit": "Px" },
    "spread": { "value": 0, "unit": "Px" },
    "color": { "r": 0, "g": 0, "b": 0, "a": 25 }
  }],
  "decorative": false,
  "children": []
}

TextNode

Styled text content. All typography properties are explicit with no cascade.

FieldTypeRequiredDescription
node_idstringyesUnique identifier
contentstringnoStatic text content
content_bindingDataBindingnoDynamic content from a DataNode
localized_contentLocalizedStringnoi18n content (alternative to static content)
font_familystringnoFont family name
font_sizeLengthnoFont size
font_weightFontWeightno100-900 weight (default Regular/400)
line_heightfloat32noLine height multiplier (default 1.5)
letter_spacingLengthnoLetter spacing
text_alignTextAlignnoStart (default), Center, End, Justify
text_overflowTextOverflownoClip (default), Ellipsis, Fade
text_decorationTextDecorationnoNone (default), Underline, LineThrough
max_linesint32noMaximum number of visible lines
colorColornoText color
opacityfloat32noOpacity 0.0-1.0 (default 1.0)
heading_levelint8no0 = not a heading, 1-6 = h1-h6 (default 0)
semantic_node_idstringnoReference to a SemanticNode
{
  "node_id": "page-title",
  "content": "Welcome to Voce",
  "heading_level": 1,
  "font_size": { "value": 3, "unit": "Rem" },
  "font_weight": "Bold",
  "color": { "r": 17, "g": 24, "b": 39, "a": 255 }
}

MediaNode

Image, video, audio, or SVG with explicit dimensions, loading strategy, and format negotiation.

FieldTypeRequiredDescription
node_idstringyesUnique identifier
media_typeMediaTypenoImage (default), Video, Audio, Svg
srcstringyesSource URL
altstringnoAlt text (required for non-decorative images)
widthLengthnoExplicit width (recommended for CLS prevention)
heightLengthnoExplicit height
aspect_ratiofloat32noAspect ratio (width/height)
object_fitObjectFitnoCover (default), Contain, Fill, ScaleDown, None
loadingLoadingStrategynoEager or Lazy (default)
corner_radiusCornerRadiinoPer-corner border radius
opacityfloat32noOpacity 0.0-1.0 (default 1.0)
srcset_widths[int32]noWidths for responsive srcset generation
sizesstringnoSizes attribute for responsive images
decorativeboolnoIf true, no alt text required (default false)
above_foldboolnoIf true, compiler uses eager loading (default false)
semantic_node_idstringnoReference to a SemanticNode
{
  "node_id": "hero-image",
  "media_type": "Image",
  "src": "/images/hero.webp",
  "alt": "Product dashboard showing analytics overview",
  "width": { "value": 100, "unit": "Percent" },
  "aspect_ratio": 1.778,
  "above_fold": true,
  "loading": "Eager"
}