Astro · Components and layouts

Create a layout

A layout wraps pages and renders their content with <slot />.

---
const { title } = Astro.props;
---
<html lang="en">
  <head><title>{title}</title></head>
  <body>
    <slot />
  </body>
</html>

Official Astro documentation

More components and layouts commands

All components and layouts commands · Astro cheatsheet

Was this page helpful?