Overview - Layout components
What is it?
Layout components in Astro are special components that help you define the common structure or design shared across multiple pages. They let you wrap your page content inside a consistent frame, like a header, footer, or sidebar, so you don't have to repeat the same code everywhere. This makes your website easier to build and maintain. Layout components separate the page's unique content from the shared design parts.
Why it matters
Without layout components, you would have to copy and paste the same header, footer, or navigation code on every page. This wastes time and causes mistakes when you want to update the design later. Layout components solve this by letting you write the shared parts once and reuse them everywhere. This saves effort, keeps your site consistent, and makes updates fast and safe.
Where it fits
Before learning layout components, you should understand basic Astro components and how to create pages. After mastering layouts, you can learn about slots for more flexible content placement and advanced routing techniques to organize your site better.
