--- title: "navbar-05" description: "Compact navbar with a two-group mega menu and a footer call-to-action row inside the panel. Mobile menu uses an expandable sheet." category: "Navbar" --- # navbar-05 Compact navbar with a two-group mega menu and a footer call-to-action row inside the panel. Mobile menu uses an expandable sheet. ## Installation ```bash php artisan ui:add-block navbar-05 ``` ## Dependencies - composer: `gehrisandro/tailwind-merge-laravel` - component: [button](https://laralcn-ui.abdulkadersafi.com/components/button.md) — the CLI installs it for you. - component: [collapsible](https://laralcn-ui.abdulkadersafi.com/components/collapsible.md) — the CLI installs it for you. - component: [sheet](https://laralcn-ui.abdulkadersafi.com/components/sheet.md) — the CLI installs it for you. ## Source `resources/views/components/ui/blocks/navbar-05.blade.php` ```blade {{-- Every piece of content is a prop, so you can drive this navbar from a CMS. A link is either a plain string or ['label' => ..., 'href' => ...]; `links` sit before the mega-menu trigger and `linksAfter` sit after it. A mega group is ['title' =>, 'items' => [...]] and each item is ['label' =>, 'description' =>, 'href' =>, 'icon' => '']. An action is ['label' =>, 'href' =>, 'variant' =>]; give it an href and it renders as a link, leave href out and it stays a plain button. Pass :cta-label="null" to drop the footer row inside the panel. --}} @props([ 'brand' => 'LaralCN', 'brandHref' => '#', 'links' => ['Link One'], 'megaLabel' => 'Link Two', 'megaGroups' => null, 'linksAfter' => ['Link Three', 'Link Four'], 'ctaText' => 'Not sure where to start?', 'ctaLabel' => 'Contact sales', 'ctaHref' => '#', 'actions' => [ ['label' => 'Sign in', 'href' => null, 'variant' => 'outline'], ['label' => 'Get Started', 'href' => null, 'variant' => 'default'], ], ]) @php $link = static fn($item): array => is_array($item) ? $item + ['href' => '#'] : ['label' => $item, 'href' => '#']; $icon = static fn( string $paths, ): string => ''; $groups = $megaGroups ?? [ [ 'title' => 'Page group one', 'items' => [ [ 'label' => 'Page One', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], [ 'label' => 'Page Two', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], [ 'label' => 'Page Three', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], ], ], [ 'title' => 'Page group two', 'items' => [ [ 'label' => 'Page Four', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], [ 'label' => 'Page Five', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], [ 'label' => 'Page Six', 'description' => 'Short description of the page goes here.', 'icon' => $icon( '', ), ], ], ], ]; @endphp
merge(['class' => 'mx-auto max-w-6xl px-4 pt-4 sm:px-6 lg:px-8']) }}>
{{-- Logo --}} {{ $logo ?? '' }} @empty($logo) @endempty {{ $brand }} {{-- Desktop navigation --}} {{-- Desktop actions --}} {{-- Mega menu panel --}} {{-- Mobile menu --}}
@foreach ($actions as $action) {{ $action['label'] ?? '' }} @endforeach
@once @endonce ```