Complete the code to define a layout component that wraps page content.
<script>
export let [1];
</script>
<main>
<slot />
</main>$page store, not a prop.In SvelteKit, the +layout.svelte file automatically wraps pages. The data prop is commonly used to access data from the load function.
Complete the code to include a navigation bar inside the layout.
<nav> <a href="/">Home</a> <a href="/about">About</a> </nav> [1]
{page} or <children /> which are not valid in Svelte.<content /> which does not exist in Svelte.The <slot /> tag is used in Svelte layouts to render the child page content inside the layout.
Fix the error in the layout script to correctly import a component.
<script> import Header from '[1]'; </script> <Header /> <slot />
./ prefix causes import errors.Relative imports in Svelte use ./ to refer to files in the same folder. So ./Header.svelte is correct.
Fill both blanks to create a layout that applies a CSS class and includes page content.
<div class="[1]"> [2] </div>
<content /> which is not valid in Svelte.The class attribute should have a valid CSS class name like layout-container. The <slot /> tag inserts the page content.
Fill all three blanks to create a layout with a header, main content slot, and footer.
<header>[1]</header> <main>[2]</main> <footer>[3]</footer>
<Content /> which is not a standard Svelte slot or component.<slot /> for page content.The layout includes a <Header /> component, a <slot /> for page content, and a <Footer /> component.