Components

Layout

The system component Layout is the starting point when creating templates in MoonShine and is used once in the build() method.

You can create a Layout using the static method make() of the Layout class.

make(iterable $components = [])
make(iterable $components = [])

$components is an array of components that are placed in the header.

namespace App\MoonShine\Layouts;use MoonShine\UI\Components\Layout\Layout;final class MoonShineLayout extends AppLayout{ public function build(): Layout { return Layout::make([ // ... ]); }}
namespace App\MoonShine\Layouts;
 
use MoonShine\UI\Components\Layout\Layout;
 
final class MoonShineLayout extends AppLayout
{
public function build(): Layout
{
return Layout::make([
// ...
]);
}
}
Any content
<x-moonshine::layout>
Any content
</x-moonshine::layout>