Layout
Structure your page with a single component
Use the Layout
component to structure and organize content on your page. They can help you speed up your development process by providing a single component that you can use to quickly set up new pages. They’re responsive, and can help you achieve a consistent design across different pages.
To customize your layout, you can set the following three props:
seo
: Use to configure metadata in thehead
tag. It expectsSEOProps
as a list of valid properties.menu
: Use to configure your main navigation. It expects theMenuProps
format for the properties.footer
: Use to configure your footer. It expects theFooterProps
format for the properties.
Layout
component in our Templates library. Slots
You can use the following named slots to insert content into different places of your layout:
The menu
and footer
slots can be used to insert additional content inside your menu/footer. In case of Svelte, you can use snippets with the same names converted to camelCase
. The menu
and footer
keys are reserved for props in this case. You can use insideMenu
and insideFooter
instead:
For the React variant, you can pass the same names as props to the Layout
component. Any additional props passed to the component not listed above will be inserted directly on the body
tag.
Themes
To change the theme of your layout, you can extend the provided layout.scss
with the following line:
API
You can find more details about the different prop types on the following pages:
Prop | Purpose |
---|---|
seo | Sets SEO-related tags in the head for the page. |
menu | Sets the main navigation menu for the page. |
footer | Sets a footer for the page. |
className | Pass additional CSS classes for the wrapper of your main content. |
For Astro, you can use the above-mentioned slots to extend your layout with different sections. For Svelte and React components, you can define the following additional snippets (Svelte) and props (React):
Svelte & React Prop | Purpose |
---|---|
insideMenu | Sets additional HTML content inside the main navigation. |
atf | Sets additional HTML content below the main navigation and above the main content. |
leftSidebar | Adds a sidebar on the left-side next to the main content. |
rightSidebar | Adds a sidebar on the right-side next to the main content. |
aboveFooter | Sets additional content above the footer and below the main content. |
scripts | Sets scripts just before the closing of the body tag. |
children | Sets the main content. |