Layout

Layouts can only have one default slot. Named slots are not supported.

Typing

Provides zero-effort type safety. Some types (in load function) can be omitted when working in some IDEs like VS Code.

In turn, annotating the load function with PageLoad, PageServerLoad, LayoutLoad or LayoutServerLoad (for +page.js, +page.server.js, +layout.js and +layout.server.js respectively) ensures that params and the return value are correctly typed. If youโ€™re using VS Code or any IDE that supports the language server protocol and TypeScript plugins then you can omit these types entirely! Svelteโ€™s IDE tooling will insert the correct types for you, so youโ€™ll get type checking without writing them yourself. It also works with our command line tool svelte-check.