Skip to main content

Template

Template is the workhorse of Evolve and by far the most common top level declaration that will be used.

A template declares the inputs, outputs, contents, and behavior of a UI element in Evolve.

A template is usually declared using a class-like structured syntax, but for the case where very few or no members are needed, a shorthand exists that looks more like a function declaration.

Sometimes you simply want to give a formal name to a container element

// using the shorthand we accept a list of declarations that are comma separated followed by a
// 'render' block where all of the template contents will go.
template ThingUsingShorthand(required string name) render {
Text(name);
}