On this page:

Add properties to a template

To add a property value to a template, insert it with ${this.propName}:

static get properties() {
  return { myProp: String };
render() { 
  return html`<p>${this.myProp}</p>`; 

See also:

Use loops in a template

Iterate over an array:

  ${this.myArray.map(i => html`<li>${i}</li>`)}

See also:

Use conditionals in a template

Render based on a Boolean condition:

    html`<p>Render some HTML if myBool is true</p>`:
    html`<p>Render some other HTML if myBool is false</p>`}


{% include projects/docs/templates/expressions/my-element.js %}

{% include project.html folder="docs/templates/expressions" openFile="my-element.js" %}