Skip to content

Document <svelte:document> #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion content/guide/06-special-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ You can also bind to certain values — so far `innerWidth`, `outerWidth`, `inne
```


### `<svelte:document>`

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`.


### `<svelte:head>`

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.
Expand All @@ -180,4 +185,4 @@ You can do that with the `<svelte:head>` tag:
</svelte:head>
```

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