Skip to content

Commit 8de4ec1

Browse files
committed
[docs] add component comments
1 parent 9d4ff67 commit 8de4ec1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

site/content/docs/02-template-syntax.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,19 @@ Comments beginning with `svelte-ignore` disable warnings for the next block of m
165165
<input bind:value={name} autofocus>
166166
```
167167

168+
---
169+
170+
You can document components with the `@component` tag. Component comments will appear when hovering over a component in an editor using the [Svelte Language Server](https://github.com/sveltejs/language-tools).
171+
172+
```sv
173+
<!--
174+
@component
175+
This is a component description.
176+
177+
@example <HelloWorld />
178+
-->
179+
<h1>Hello world</h1>
180+
```
168181

169182
### {#if ...}
170183

0 commit comments

Comments
 (0)