<svelte:options>
<svelte:options option={value} />
The <svelte:options>
element provides a place to specify per-component compiler options, which are detailed in the compiler section. The possible options are:
runes={true}
β forces a component into runes mode (see the Legacy APIs section)runes={false}
β forces a component into legacy modenamespace="..."
β the namespace where this component will be used, can be βhtmlβ (the default), βsvgβ or βmathmlβcustomElement={...}
β the options to use when compiling this component as a custom element. If a string is passed, it is used as thetag
optioncss="injected"
β the component will inject its styles inline: During server-side rendering, itβs injected as a<style>
tag in thehead
, during client side rendering, itβs loaded via JavaScript
Legacy mode
Deprecated options Svelte 4 also included the following options. They are deprecated in Svelte 5 and non-functional in runes mode.
immutable={true}
β you never use mutable data, so the compiler can do simple referential equality checks to determine if values have changedimmutable={false}
β the default. Svelte will be more conservative about whether or not mutable objects have changedaccessors={true}
β adds getters and setters for the componentβs propsaccessors={false}
β the default
<svelte:options customElement="my-custom-element" />
Edit this page on GitHub llms.txt
previous next