Skip to content

Layout

Generated from project.v1.schema.json at the documented engine version. The schema checks shape only; the engine’s validation also checks ranges, limits, references and keyframe order.

AlignContent

Where the lines of a wrapping flex container, or a grid's rows, lie across the container.

  • "start" Packed at the start.
  • "center" Packed in the middle.
  • "end" Packed at the end.
  • "space_between" The first at the start, the last at the end, equal space between.
  • "space_around" Equal space around each.
  • "space_evenly" Equal space between each and at both ends.
  • "stretch" Grown to fill the container.

AlignItems

Where children lie across a flex container's main axis, or in their grid areas.

  • "start" At the start.
  • "center" In the middle.
  • "end" At the end.
  • "stretch" Across the whole line or area.

Display

How a box lays its children out.

  • "flex" CSS flexbox.
  • "grid" CSS grid.

FlexDirection

The main axis of a flex container.

  • "row" Left to right.
  • "column" Top to bottom.
  • "row_reverse" Right to left.
  • "column_reverse" Bottom to top.

FlexWrap

Whether a flex container's children wrap.

  • "nowrap" One line.
  • "wrap" As many lines as the children need.

GridAutoFlow

How a grid places items that have no placement of their own.

  • "row" Filling each row, adding rows.
  • "column" Filling each column, adding columns.
  • "row_dense" As row, filling earlier holes.
  • "column_dense" As column, filling earlier holes.

GridPlacement

Where a grid item lies on one axis, as CSS writes it: 2, "1 / 3", "span 2", "2 / span 3", "auto". Lines count from 1, or from -1 at the end.

One of:

integer

string

Insets

A length on each side of a box: one length for every side, the CSS shorthand of one to four lengths ("8px 16px": top first, clockwise), or the sides object, missing sides 0.

One of:

number <span class="a2-muted">(float)</span>

string

object

FieldTypeDescription
bottomLayoutSize
leftLayoutSize
rightLayoutSize
topLayoutSize

JustifyContent

Where children lie along a container's main axis, or a grid's columns in it.

  • "start" Packed at the start.
  • "center" Packed in the middle.
  • "end" Packed at the end.
  • "space_between" The first at the start, the last at the end, equal space between.
  • "space_around" Equal space around each.
  • "space_evenly" Equal space between each and at both ends.

LayoutBorder

A border inside the border box, as wide on every side.

FieldTypeDescription
paintrequiredAnimated_Paint

What covers the border. Positions are normalized to the border box.

widthrequiredAnimated_LayoutSize

Width. At least 0.

LayoutInset

Where an absolute box lies in its parent's padding box. A missing side is auto; with neither left nor right, the box keeps its flow position on that axis.

FieldTypeDescription
bottomAnimated_LayoutLength | null

Distance from the parent's bottom padding edge.

leftAnimated_LayoutLength | null

Distance from the parent's left padding edge.

rightAnimated_LayoutLength | null

Distance from the parent's right padding edge.

topAnimated_LayoutLength | null

Distance from the parent's top padding edge.

LayoutLength

A length: a number is a fraction of the layout picture's shorter side, "<n>px" pixels of the project canvas, "<n>%" a percent of the parent's content box along the field's axis.

One of:

number <span class="a2-muted">(float)</span>

string

LayoutNode

One box of a layout tree.

A box lays its children out by flexbox (the default) or grid. It is a container with children, a leaf with text or shape content, and empty otherwise (a spacer or decoration). Each box draws background, then border, then content. Boxes draw in document order; reversed directions and grid placement move them but do not change paint order.

FieldTypeDescription
align_contentAlignContent | null

Where lines of a wrapping flex container, or a grid's rows, lie across the container. Default stretch.

align_itemsAlignItems | null

Where children lie across the main axis, or in their grid areas' rows. Default stretch.

align_selfAlignItems | null

Where the box lies across its flex container's main axis, or in its grid area's row. None follows the parent's align_items.

aspect_rationumber | null

Width over height. Positive.

backgroundAnimated_Paint | null

What covers the border box, rounded by border_radius. Positions are normalized to the border box.

borderLayoutBorder | null

A border inside the border box.

border_radiusAnimated_LayoutSize | null

The corner radius of the border box. At least 0; default 0. Capped at half the box's shorter side.

childrenLayoutNode[]

Boxes laid out in this one, in document (and paint) order. Not with text or shape.

column_gapAnimated_LayoutSize | null

Space between columns, in place of gap. At least 0.

displayDisplay | null

How the box lays its children out. Default flex. Like every container field, not on a box with text or shape content.

fillPaint | null

What paints the text's glyphs, as a text style's fill. Inherited; the root's is white.

flex_basisAnimated_LayoutLength | null

The main size before growing and shrinking. None is auto.

flex_directionFlexDirection | null

The main axis of a flex container's children. Default row.

flex_growAnimated_float | null

How much of a flex container's free space the box takes. At least 0; default 0. Like every flex item field, not in a grid.

flex_shrinkAnimated_float | null

How much the box gives up when a flex container's space runs short. At least 0; default 1.

flex_wrapFlexWrap | null

Whether a flex container's children wrap onto more lines. Default nowrap.

font_familystring | null

The family the box's text draws in, as a text style's font_family. Inherited; the root's is the host's first font.

font_sizeAnimated_LayoutSize | null

Font size: positive, at most MAX_LAYOUT_FONT_SIZE of the picture's shorter side. Inherited; the root's is 0.05.

font_weightinteger | null

The weight in [1, 1000] used to match the family's faces, as a text style's font_weight. Not animated. Inherited; the root's is 400.

gapAnimated_LayoutSize | null

Space between children, on both axes. At least 0; default 0.

grid_auto_columnsTrackList | null

The size of a grid's implicit columns. Default auto.

grid_auto_flowGridAutoFlow | null

How a grid places items without a placement. Default row.

grid_auto_rowsTrackList | null

The size of a grid's implicit rows. Default auto.

grid_columnGridPlacement | null

The box's columns in its grid, as CSS writes them (2, "1 / 3", "span 2"). Default auto.

grid_rowGridPlacement | null

The box's rows in its grid. Default auto.

grid_template_columnsTrackList | null

A grid's explicit columns, as CSS writes them ("1fr 2fr", "repeat(3, minmax(100px, 1fr))"). Default none.

grid_template_rowsTrackList | null

A grid's explicit rows. Default none.

heightAnimated_LayoutLength | null

Border-box height. None is auto.

insetLayoutInset | null

Where an absolute box lies in its parent's padding box.

justify_contentJustifyContent | null

Where children lie along the main (for a grid, inline) axis. Default start.

justify_itemsAlignItems | null

Where a grid's children lie in their grid areas' columns. Default stretch.

justify_selfAlignItems | null

Where the box lies in its grid area's column. None follows the parent's justify_items. Like every grid item field, not in a flex container.

letter_spacingnumber | null

Space after each character, as a fraction of the font size, in [-0.5, 1], as a text style's letter_spacing. Not animated. Inherited; the root's is 0.

line_heightnumber | null

Baseline-to-baseline distance in font sizes, in [0.5, 3], as a text style's line_height. Inherited; the root's is 1.2.

marginAnimated_Insets | null

Space outside the border, written as padding is. Sides may be negative; no auto.

max_heightAnimated_LayoutLength | null

Largest height. None is none.

max_widthAnimated_LayoutLength | null

Largest width. None is none.

min_heightAnimated_LayoutLength | null

Smallest height. None is auto.

min_widthAnimated_LayoutLength | null

Smallest width. None is auto, the CSS automatic minimum size.

opacityAnimated_float | null

Opacity of the box and everything in it as one group, in 0..=1. Applied after layout.

overflowOverflow | null

Whether content past the padding box is drawn. Default visible.

paddingAnimated_Insets | null

Space inside the border: a length, the CSS shorthand ("8px 16px"), or the sides object. Sides at least 0; default 0.

positionPosition | null

Whether the box is in its parent's flow. Default relative.

rotation_degreesAnimated_float | null

Clockwise rotation of the box and everything in it about its border-box centre, in degrees, after layout.

row_gapAnimated_LayoutSize | null

Space between rows (or lines of a wrapping row flex container), in place of gap. At least 0.

scaleAnimated_Vec2 | null

Per-axis scale of the box and everything in it about its border-box centre, after layout.

shadowsarray | null

Shadows of the glyphs and strokes, as a text style's shadows. Inherited as a whole list (as CSS text-shadow); the root has none.

shapeLayoutShape | null

Shapes drawn on a picture the size of the box's content box. Not with children or text.

strokesarray | null

Bands around the glyphs, as a text style's strokes. Inherited as a whole list; the root has none.

textAnimated_string | null

The box's text, wrapped at its content width in the inherited style; \n starts a line. At most MAX_TEXT_CONTENT_BYTES bytes per value; may be empty. Keyframes all hold. Not with children or shape.

text_alignTextAlign | null

How lines align within the content width. Inherited; the root's is start.

text_animatorsTextAnimator[]

Per-character motion of the box's own text, Range selectors only (layout text has no runs). At most MAX_TEXT_ANIMATORS, keyed in picture time. Not inherited; never changes layout.

translateAnimated_LayoutOffset | null

Offset of the box and everything in it after layout: the object, or one or two lengths as CSS translate writes them.

widthAnimated_LayoutLength | null

Border-box width. None is auto. Like every item field, not on the root.

LayoutOffset

An offset, x right and y down: one or two lengths as CSS translate writes them (y 0 when missing), or {x, y}.

One of:

string

object

FieldTypeDescription
xrequiredLayoutSize
yrequiredLayoutSize

LayoutShape

A box's shapes, drawn as a shapes generator draws its items on a picture the size of the box's content box. A shape box has no size of its own.

FieldTypeDescription
itemsrequiredShapeItem[]

The content tree, front first.

LayoutSize

A length that may not be a percent: a number is a fraction of the layout picture's shorter side, "<n>px" pixels of the project canvas.

One of:

number <span class="a2-muted">(float)</span>

string

Overflow

Whether content past a box's padding box is drawn.

  • "visible" Drawn.
  • "hidden" Clipped to the padding box.