A layout is used for its sibling page and all descendants. This layout would be used for src/routes/+page.svelte
, src/routes/about/+page.svelte
, etc.
The current page will be rendered in a slot.
Layout components are rendered around a page, and put the page contents in a slot. Layouts are applied to all pages in the subtree.
A layout is used for its sibling page and all descendants. This layout would be used for src/routes/+page.svelte
, src/routes/about/+page.svelte
, etc.
The current page will be rendered in a slot.
Like page components and page scripts, layouts can be accompanied by a layout script to pass data to the layout component.
Layout data will be merged with the page data and is also available in page components.
Further reading on this topic.