Skip to content

Commit 9d1aa69

Browse files
Docs: Updated the custom elements documentation to include $host (#16686)
* Updated the custom elements documentation to include * moved the rune reference further up * Small update to the sentence * updated the formatting * Update documentation/docs/07-misc/04-custom-elements.md --------- Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 parent 942eaf0 commit 9d1aa69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

documentation/docs/07-misc/04-custom-elements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Custom elements
44

55
<!-- - [basically what we have today](https://svelte.dev/docs/custom-elements-api) -->
66

7-
Svelte components can also be compiled to custom elements (aka web components) using the `customElement: true` compiler option. You should specify a tag name for the component using the `<svelte:options>` [element](svelte-options).
7+
Svelte components can also be compiled to custom elements (aka web components) using the `customElement: true` compiler option. You should specify a tag name for the component using the `<svelte:options>` [element](svelte-options). Within the custom element you can access the host element via the [`$host`](https://svelte.dev/docs/svelte/$host) rune.
88

99
```svelte
1010
<svelte:options customElement="my-element" />

0 commit comments

Comments
 (0)