0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/documentation/content/faq/450-how-do-i-document-my-components.md
2023-05-13 08:06:21 -07:00

630 B

question
How do I document my components?

In editors which use the Svelte Language Server you can document Components, functions and exports using specially formatted comments.

<script>
	/** What should we call the user? */
	export let name = 'world';
</script>

<!--
@component
Here's some documentation for this component.
It will show up on hover.

- You can use markdown here.
- You can also use code blocks here.
- Usage:
  ```tsx
  <main name="Arethra">
  ```
-->
<main>
	<h1>
		Hello, {name}
	</h1>
</main>

Note: The @component is necessary in the HTML comment which describes your component.