Template Node

Templates provide a way to reuse parts of your app (also known as composition).

Templates are composed from multiple nodes (components) in the same way a Page is composed. To access Templates in the Editor look for Template Nodes in the left panel or press 3.

Nodes such as instances and iterators are configured to use templates, and will "instantiate" the template at the location specified by the instance. Additional scope can be provided to the template using the scope property, which is available at {{scope.element}} within the template.

Properties

Min Height

PropminHeight
Typestring
Defaultundefined

The minimum height of the template when instantiated.

Height

Propheight
Typestring
Default128px

The height of the template when instantiated.

Max Height

PropmaxHeight
Typestring
Defaultundefined

The maximum height of the template when instantiated.

Min Width

PropminWidth
Typestring
Defaultundefined

The minimum width of the template when instantiated.

Width

Propwidth
Typestring
Default320px

The width of the template when instantiated.

Max Width

PropmaxWidth
Typestring
Defaultundefined

The maximum width of the template when instantiated.

Background Color

PropbackgroundColor
Typestring
Defaultundefined

The background color of the template when instantiated.

Layout Style

ProplayoutStyle
TypeNodeLayoutStyle ('GRID' | 'HORIZONTAL_STACK' | 'VERTICAL_STACK')
DefaultGRID

The layout style used by the template to arrange its children. Can be either a grid, horizontal stack, or vertical stack.

Grid Columns

PropgridColumns
Typenumber
Default12

The number of columns in the container's grid system.

Grid Rows

PropgridRows
Typenumber
Default0

The number of rows in the container's grid system, expanding to fill the container.

Grid Row Height

PropgridRowHeight
Typestring
Default16

The height of each row within the container's grid system, in pixels.

Row Gap

PropgridRowGap
Typestring
Default4

The space between each row within the container's grid system, in pixels.

Column Gap

PropgridColumnGap
Typestring
Default4

The space between each column within the container's grid system, in pixels.

Distribute Content

PropdistributeContent
TypeNodeLayoutDistributeStyle ('start' | 'center' | 'end' | 'around' | 'between' | 'even')
Defaultstart

The distribution of the children nodes within the template. Corresponds to the justify-content CSS Flexbox property.

Align Content

PropalignContent
TypeNodeLayoutAlignStyle ('start' | 'center' | 'end')
Defaultstart

The alignment of the children nodes within the template. Corresponds to the align-items CSS Flexbox property.

Wrap Content

PropwrapContent
TypeNodeLayoutWrapStyle ('wrap' | 'nowrap' | 'wrap-reverse')
Defaultnowrap

How the children nodes wrap within the container. Corresponds to the flex-wrap CSS Flexbox property.

Padding

Proppadding
Typestring
Default0

The internal padding of the template to place around its children.

Spacing

Propspacing
Typestring
Default8

The spacing to use between child nodes of the container.

Custom Styles

Propstyles
Typestring
Defaultelement.styles { }

Custom CSS styles to be applied to the node. Use element.styles to refer to the current node.

Default Scope

Propscope
Typeunknown
Default{}

Additional data with which to populate the template. This data will be available as {{scope}} within the template.

Merge Default Scope

PropmergeDefaultScope
Typeboolean
Default{{true}}

Merge default template scope with the scope data from the instance