Adding New Items

Rendering new items

If you want to render a new item to the page:

  1. Render items using a {{#for}} loop
{{#for item in items}}
  <div object key:name="@innerText">{{item.name}}</div>
{{/for}}
  1. Reference the name in the for loop in a new: attribute
<button new:item>Create new item</button>
  1. Remake will take care of the rest
  • Remake searches the page for a matching name in a {{#for}} loop on the page (if none is found, it searches the app/partials directory)
  • Remake renders the inner part of the {{#for}} loop
  • Remake adds the rendered item to the nearest element with a list tag (tip: you can customize where it adds the item by specifying a selector as the value of the new: attribute)

→ Sorting Lists of Items

View on GitHub
☰ Menu