Note: Jet.Js ia ALPA yet, can have any bugs. Found a bug, report Here.

Templating

Basic Concepts

‘tpl’ – The Template

tpl is the most important part of a Jet component.
It defines the HTML that your component will render.

You write it as plain HTML inside backticks ` and can use:

How to write tpl

Technically, tpl is just a component property.
It can be written in three ways:

Examples

// As a plain string
tpl: `<h1>Bazinga!</h1>`

// As a function
tpl() {
  return `<h1>Bazinga!</h1>`
}

// With tagged template for formatting
tpl() {
  return html`
    <h1>Bazinga!</h1>
  `
}

Why use a function?

Using a function gives you more flexibility:

While plain strings are fine for simple layouts, functions give you power when things grow

⚠️Note: This documentation is still being written and updated regularly. For now it rather short, but will be detailed and will be added more examples. Jet.js is in alpha, so features may change or improve quickly.
It’s recommended to subscribe for mailing list to be informed in time Click here