Skip to content

Commit 5768dec

Browse files
authored
Merge pull request #376 from acstll/document-document-component
Document <svelte:document>
2 parents eaa8be6 + 51d1ade commit 5768dec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

content/guide/06-special-components.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ You can also bind to certain values — so far `innerWidth`, `outerWidth`, `inne
167167
```
168168

169169

170+
### `<svelte:document>`
171+
172+
The `<svelte:document>` tag, just like `<svelte:window>`, gives you a convenient way to declaratively add event listeners to the `document` object. This is useful for listening to events that don't fire on `window`, such as `mouseenter` and `mouseleave`.
173+
174+
170175
### `<svelte:head>`
171176

172177
If you're building an application with Svelte — particularly if you're using [Sapper](https://sapper.svelte.technology) — then it's likely you'll need to add some content to the `<head>` of your page, such as adding a `<title>` element.
@@ -180,4 +185,4 @@ You can do that with the `<svelte:head>` tag:
180185
</svelte:head>
181186
```
182187

183-
When [server rendering](guide#server-side-rendering), the `<head>` contents can be extracted separately to the rest of the markup.
188+
When [server rendering](guide#server-side-rendering), the `<head>` contents can be extracted separately to the rest of the markup.

0 commit comments

Comments
 (0)