Chapter 2: Template Syntax

In the first chapter, we got introduced to the history of Svelte and made our first little steps at writing a simple component. In this and the following chapters, we’ll have a closer look at specific aspects of writing Svelte code. In the end, you’ll be able to create applications in Svelte that scale. We’ll start with taking a deep dive into Svelte’s template syntax.

Similar to Angular or Vue, Svelte enhances the HTML syntax with several features for expressing dynamic properties, loops, and more. We’ll take a look at each of them and see how they help you write readable code. One of the nice things about Svelte is that you can start with “just HTML” and gradually enhance your markup with dynamic features. You do ...

Get Svelte: A Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.