Introduction
Runes
Template syntax
Styling
Special elements
Runtime
Misc
Reference
Legacy APIs
SvelteReference
svelte/server
import{functionrender<CompextendsSvelteComponent<any>|Component<any>,PropsextendsComponentProps<Comp>=ComponentProps<Comp>>(...args:{}extendsProps?[component:CompextendsSvelteComponent<any>?ComponentType<Comp>:Comp,options?:{props?:Omit<Props,"$$slots"|"$$events">;context?:Map<any,any>;idPrefix?:string;}]:[component:CompextendsSvelteComponent<any>?ComponentType<Comp>:Comp,options:{props:Omit<Props,"$$slots"|"$$events">;context?:Map<any,any>;idPrefix?:string;}]):RenderOutput
Only available on the server and when compiling with theserver
option.Takes a component and returns an object withbody
andhead
properties on it, which you can use to populate the HTML when server-rendering your app.
render}from'svelte/server';
render
Only available on the server and when compiling with theserver
option.Takes a component and returns an object withbody
andhead
properties on it, which you can use to populate the HTML when server-rendering your app.
functionrender<CompextendsSvelteComponent<any>|Component<any>,PropsextendsComponentProps<Comp>=ComponentProps<Comp>>(...args:{}extendsProps?[component:CompextendsSvelteComponent<any>?ComponentType<Comp>:Comp,options?:{props?:Omit<Props,'$$slots'|'$$events'>;context?:Map<any,any>;idPrefix?:string;}]:[component:CompextendsSvelteComponent<any>?ComponentType<Comp>:Comp,options:{props:Omit<Props,'$$slots'|'$$events'>;context?:Map<any,any>;idPrefix?:string;}]):RenderOutput;
Edit this page on GitHub llms.txt
previousnext