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>
main
Jinay Patel 4 days ago committed by GitHub
parent 942eaf027b
commit 9d1aa699b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,7 +4,7 @@ title: Custom elements
<!-- - [basically what we have today](https://svelte.dev/docs/custom-elements-api) -->
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).
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.
```svelte
<svelte:options customElement="my-element" />

Loading…
Cancel
Save