pull/10024/head
Puru 3 years ago
parent fa96bc91d9
commit 829362c165

@ -2,6 +2,8 @@
title: Basic markup
---
Basics of svelte's template syntax. These are smallest building blocks of [svelte components](./svelte-components).
## Tags
A lowercase tag, like `<div>`, denotes a regular HTML element. A capitalised tag, such as `<Widget>` or `<Namespace.Widget>`, indicates a _component_.

@ -2,6 +2,8 @@
title: Logic blocks
---
HTML doesn't have a way of expressing logic, like conditionals and loops. Svelte does. It uses special tags `{#if}`, `{#each}` and `{#await}` to add logic to your markup.
## {#if ...}
```svelte

@ -2,6 +2,8 @@
title: Special tags
---
These are special tags to add logic to your markup, inline.
## {@html ...}
```svelte

@ -2,6 +2,8 @@
title: Component directives
---
Directives supported on invoking components. These allow listening to events, binding to props, and more.
## on:_eventname_
```svelte

@ -2,6 +2,8 @@
title: Special elements
---
Svelte provides a variety of built-in elements. These are not part of the DOM, but are instead handled by the compiler, and ease the process of working with higher level DOM elements easier, alongside providing instructions to the compiler.
## `<slot>`
```svelte

@ -2,6 +2,8 @@
title: 'Client-side component API'
---
Svelte provides a client-side API for interacting with components. This allows you to create components programmatically, and to access their properties and methods.
## Creating a component
```ts

Loading…
Cancel
Save