layout.php
A layout is UI that is shared between routes.
A root layout is the top-most layout in the root app directory. It is used to define the <html> and <p> tags and other globally shared UI.
Creating a Layout
To create a layout, you can create a new PHP file in the app directory. The file should be named layout.php
.
Using a Layout
Layouts will be add be default to all routes inheriting from the root layout then child layouts.
For example, in the following directory structure, dashboard/layout.php
is the common layout for both /dashboard/settings
and /dashboard/analytics
: