{{-- The scaffold: M3's structure of bars, rails and panes around the page, and the FAB, with navigation that changes shape with the window (docs/reference/m3/foundations.md ยง Layout โ†’ Scaffold). Before 2.0.0 it was ``. Props, slots and the breakpoint table are in SKILL.md โ€” this is the WHY behind the wiring, not the API. `actions`' collapsed-column layout queries the rail's published `--md-navigation-rail-value` rather than a breakpoint of its own, so `resources/css/layout/scaffold.css` stays in step with the rail's conditions without repeating them. `--md-layout-margin: 0px` on the content region (resources/css/layout/scaffold.css) is read by layout/pane.css: a pane or canonical layout inside the scaffold draws no margin of its own because it can see it is already in a margined region. The snackbar host (``) is part of the scaffold, not a separate element an app adds: Compose raises the snackbar over its FAB, but here the host is one fixed element every page shares, so the FAB (`fab` slot) is what moves above it instead (resources/css/layout/scaffold.css); both clear the bottom bar through `--material-bottom-bar` on a compact window (the bar's 64px, the safe-area inset and `--material-bottom-extra`, 0px unless the application docks something above the bar). Nothing application-specific belongs in here: an app's destinations and chrome come in through the props and slots. The caller's `class` and `style` land on the root, `data-md-scaffold` itself โ€” the element `style="--material-banner: 4rem"` (SKILL.md) sets a custom property on. --}} @props([ 'destinations' => [], 'label' => null, 'railWidth' => '16rem', 'tallBar' => false, 'hideBarOnScroll' => false, 'hideRailWhenCollapsed' => false, ]) @php $label ??= __('Main'); $current = \Livewire\Livewire::isLivewireRequest() ? \Livewire\Livewire::originalUrl() : request()->url(); $items = collect($destinations) ->filter(fn ($item): bool => is_array($item) && filled($item['title'] ?? null)) ->map(fn (array $item): array => [ 'title' => (string) $item['title'], 'icon' => $item['icon'] ?? null, 'url' => $item['url'] ?? null, 'active' => (bool) ($item['active'] ?? (filled($item['url'] ?? null) && rtrim(url($item['url']), '/') === rtrim($current, '/'))), 'badge' => $item['badge'] ?? null, 'badgeLabel' => filled($item['badgeLabel'] ?? null) ? (string) $item['badgeLabel'] : null, 'section' => filled($item['section'] ?? null) ? (string) $item['section'] : null, 'bar' => ($item['bar'] ?? true) !== false, 'navigate' => ($item['navigate'] ?? true) !== false, ]) ->values(); $barItems = $items->where('bar', true)->values(); // Consecutive destinations under the same heading form one group, in the order given. $groups = $items->chunkWhile(fn (array $item, int $key, $chunk): bool => $item['section'] === $chunk->last()['section']); @endphp
only(['class', 'style']) }}> {{ __('Skip to content') }} @isset($banner)
{{ $banner }}
@endisset
@isset($brand) {{ $brand }} @endisset @isset($railHeader) {{ $railHeader }} @endisset @foreach ($groups as $group) @if ($group->first()['section'] !== null) @foreach ($group as $item) @endforeach @else @foreach ($group as $item) @endforeach @endif @endforeach @if (isset($railFooter) || isset($actions)) {{ $railFooter ?? '' }} @isset($actions)
{{ $actions }}
@endisset
@endif
{{ $top ?? '' }} @isset($fab)
{{ $fab }}
@endisset
{{ $slot }}
@if ($barItems->isNotEmpty())
@foreach ($barItems as $item) @endforeach
@endif