Cottons makes building layouts a piece of cake. Let's start with composing a base layout that contains the base of our view:
<html>
<head>
...
</head>
<body>
{{ slot }}
</body>
</html>
Imagine that we're creating a web app with an authenticated area, so we'll need areas for guests and users. Let's create these, extending from the base component.
<c-layouts.base>
{{ slot }}
</c-layouts.base>
<c-layouts.base>
<div class="sidebar">
{{ sidebar }}
</div>
<div class="main">
{{ slot }}
</div>
</c-layouts.base>
<c-layouts.guest>
<div id="loginForm">
<input name="email" type="email" placeholder="Email">
...
</div>
</c-layouts.guest>
<c-layouts.app>
<c-slot name="sidebar">
<a href="/dashboard">Dashboard</a>
...
</c-slot>
<div id="dashboard">
...
</div>
</c-layouts.app>