Nova · Layouts

Templates

A string with {{…}} in it is a template. Each expression between the braces is resolved and written into the sentence.

The action, as it is written
{
  id: 'templates',
  data: { name: 'Ada', count: 3 },
  layout: {
    component: 'Stack',
    children: [
      { component: 'Text', children: 'Hello, {{$.name}}.' },
      {
        component: 'Text',
        children: '{{$.count}} new messages',
      },
    ],
  },
}
Running herepress it

Hello, Ada.

3 new messages

What is done to it
Nothing. It is only drawn.
What it then holds
{ name: 'Ada', count: 3 }
What it then says
Hello, Ada.
3 new messages
Output matches the expected value

Left: the action as the package ships it. Right: the same action running in this page, rendered with this site’s components. Below: the action run as the example specifies, on the installed package.