Your First Template

Browser Demo

1. Install Squirrelly

Follow the installation instructions, then require or import Squirrelly. In this example, we'll require Squirrelly as the variable Sqrl.

2. Create a Template

In this example, we're using JavaScript template literals. You don't have to use template literals with Squirrelly. It just makes it easier to write templates, since you don't have to escape newlines. In real life, most templates are their own files.

3. Render your Template!

Try rendering it with other data: it still works!

Last updated