Astro Islands & SSR (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are Layouts and Slots in Astro?
senior LevelCode ExampleAstro
In Simple Words:
- Layout Component (
src/layouts/BaseLayout.astro): Shared shell wrapping pages with<html>,<head>, navigation, and footer. <slot />: Defines where page-specific child content is injected inside the layout:astro--- // BaseLayout.astro const { title } = Astro.props; --- <html> <head><title>{title}</title></head> <body> <nav>Header</nav> <slot /> <!-- Injects page content here --> <footer>Footer</footer> </body> </html>